Dart API Referencedart:ioHttpClientResponse

HttpClientResponse abstract class

HTTP response for a client connection.

abstract class HttpClientResponse {
  /**
   * Returns the status code.
   */
  int get statusCode;

  /**
   * Returns the reason phrase associated with the status code.
   */
  String get reasonPhrase;

  /**
   * Returns the content length of the request body. If the size of
   * the request body is not known in advance this -1.
   */
  int get contentLength;

  /**
   * Gets the persistent connection state returned by the server.
   */
  bool get persistentConnection;

  /**
   * Returns whether the status code is one of the normal redirect
   * codes [:HttpStatus.MOVED_PERMANENTLY:], [:HttpStatus.FOUND:],
   * [:HttpStatus.MOVED_TEMPORARILY:], [:HttpStatus.SEE_OTHER:] and
   * [:HttpStatus.TEMPORARY_REDIRECT:].
   */
  bool get isRedirect;

  /**
   * Returns the response headers.
   */
  HttpHeaders get headers;

  /**
   * Cookies set by the server (from the Set-Cookie header).
   */
  List<Cookie> get cookies;

  /**
   * Returns the input stream for the response. This is used to read
   * the response data.
   */
  InputStream get inputStream;
}

Properties

final int contentLength #

Returns the content length of the request body. If the size of the request body is not known in advance this -1.

int get contentLength;

final List<Cookie> cookies #

Cookies set by the server (from the Set-Cookie header).

List<Cookie> get cookies;

final HttpHeaders headers #

Returns the response headers.

HttpHeaders get headers;

final InputStream inputStream #

Returns the input stream for the response. This is used to read the response data.

InputStream get inputStream;

final bool isRedirect #

Returns whether the status code is one of the normal redirect codes HttpStatus.MOVED_PERMANENTLY, HttpStatus.FOUND, HttpStatus.MOVED_TEMPORARILY, HttpStatus.SEE_OTHER and HttpStatus.TEMPORARY_REDIRECT.

bool get isRedirect;

final bool persistentConnection #

Gets the persistent connection state returned by the server.

bool get persistentConnection;

final String reasonPhrase #

Returns the reason phrase associated with the status code.

String get reasonPhrase;

final int statusCode #

Returns the status code.

int get statusCode;