contentLength property

int contentLength
getter/setter pair

Gets and sets the content length of the request.

For request methods that do not anticipate a body (such as "GET" and "HEAD"), the default is 0 and chunked transfer encoding is not used when contentLength is negative.

For other methods (such as "POST" and "PUT"), the default is -1, indicating that the size of the request is not known in advance and chunked transfer encoding will be used.

Implementation

int contentLength = -1;