Function

Soupheaders_parse_request

Declaration [src]

guint
soup_headers_parse_request (
  const char* str,
  int len,
  SoupMessageHeaders* req_headers,
  char** req_method,
  char** req_path,
  SoupHTTPVersion* ver
)

Description [src]

Parses the headers of an HTTP request in str and stores the results in req_method, req_path, ver, and req_headers.

Beware that req_headers may be modified even on failure.

Parameters

str const char*
 

The headers (up to, but not including, the trailing blank line)

 The data is owned by the caller of the function.
 The string is a NUL terminated UTF-8 string.
len int
 

Length of str.

req_headers SoupMessageHeaders
 

SoupMessageHeaders to store the header values in.

 The data is owned by the caller of the function.
req_method char**
 

If non-NULL, will be filled in with the request method.

 The argument will be set by the function.
 The argument can be NULL.
 The called function takes ownership of the data, and is responsible for freeing it.
 The string is a NUL terminated UTF-8 string.
req_path char**
 

If non-NULL, will be filled in with the request path.

 The argument will be set by the function.
 The argument can be NULL.
 The called function takes ownership of the data, and is responsible for freeing it.
 The string is a NUL terminated UTF-8 string.
ver SoupHTTPVersion
 

If non-NULL, will be filled in with the HTTP version.

 The argument will be set by the function.
 The argument can be NULL.
 The called function takes ownership of the data, and is responsible for freeing it.

Return value

Returns: guint
 

SOUP_STATUS_OK if the headers could be parsed, or an HTTP error to be returned to the client if they could not be.