Soup.Message.set_request_body

### Method

# Soup Messageset_request_body

#### Declaration [src]

    void
    soup_message_set_request_body (
      SoupMessage* msg,
      const char* content_type,
      GInputStream* stream,
      gssize content_length
    )

#### Description [src]

Set the request body of a `SoupMessage`.

If `content_type` is `NULL` and `stream` is not `NULL` the Content-Type header will not be changed if present. The request body needs to be set again in case `msg` is restarted (in case of redirection or authentication).

#### Parameters

`content_type`

  Type: `const char*`

  MIME Content-Type of the body, or `NULL` if unknown.

  The argument can be `NULL`.
  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`stream`

  Type: `GInputStream`

  A `GInputStream` to read the request body from.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`content_length`

  Type: `gssize`

  The byte length of `stream` or -1 if unknown.