MessageHeaders.setContentLength

Sets the message body length that @hdrs will declare, and sets @hdrs's encoding to %SOUP_ENCODING_CONTENT_LENGTH.

You do not normally need to call this; if @hdrs is set to use Content-Length encoding, libsoup will automatically set its Content-Length header for you immediately before sending the headers. One situation in which this method is useful is when generating the response to a HEAD request; Calling soup_message_headers_set_content_length() allows you to put the correct content length into the response without needing to waste memory by filling in a response body which won't actually be sent.

class MessageHeaders
void
setContentLength

Parameters

contentLength long

the message body length

Meta