BaseResponse(int statusCode, { int contentLength, BaseRequest request, Map<String, String> headers: const {}, bool isRedirect: false, bool persistentConnection: true, String reasonPhrase })

Creates a new HTTP response.

Source

BaseResponse(
    this.statusCode,
    {this.contentLength,
     this.request,
     this.headers: const <String, String>{},
     this.isRedirect: false,
     this.persistentConnection: true,
     this.reasonPhrase}) {
  if (statusCode < 100) {
    throw new ArgumentError("Invalid status code $statusCode.");
  } else if (contentLength != null && contentLength < 0) {
    throw new ArgumentError("Invalid content length $contentLength.");
  }
}