Dart API Referencedart:ioHttpClientRequest

HttpClientRequest Interface

HTTP request for a client connection.

Methods

Code List<Cookie> get cookies() #

Cookies to present to the server (in the Cookie header).

List<Cookie> get cookies();

Code HttpHeaders get headers() #

Returns the request headers.

HttpHeaders get headers();

Code OutputStream get outputStream() #

Returns the output stream for the request. This is used to write the request data. When all request data has been written close the stream to indicate the end of the request.

When this is accessed for the first time the request header is send. Calling any methods that will change the header after having retrieved the output stream will throw an exception.

OutputStream get outputStream();

Fields

Code int contentLength #

Gets and sets the content length of the request. If the size of the request is not known in advance set content length to -1, which is also the default.

int contentLength;

Code bool persistentConnection #

Gets and sets the requested persistent connection state. The default value is true.

bool persistentConnection;