Method

SoupMessageHeadersget_content_disposition

Declaration [src]

gboolean
soup_message_headers_get_content_disposition (
  SoupMessageHeaders* hdrs,
  char** disposition,
  GHashTable** params
)

Description [src]

Looks up the “Content-Disposition” header in hdrs, parses it, and returns its value in disposition and params.

params can be NULL if you are only interested in the disposition-type.

In HTTP, the most common use of this header is to set a disposition-type of “attachment”, to suggest to the browser that a response should be saved to disk rather than displayed in the browser. If params contains a “filename” parameter, this is a suggestion of a filename to use. (If the parameter value in the header contains an absolute or relative path, libsoup will truncate it down to just the final path component, so you do not need to test this yourself.)

Content-Disposition is also used in “multipart/form-data”, however this is handled automatically by SoupMultipart and the associated form methods.

Parameters

disposition

Type: char**

Return location for the disposition-type, or NULL.

The argument will be set by the function.
The instance takes ownership of the data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.
params

Type: GHashTable

Return location for the Content-Disposition parameters, or NULL.

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

Return value

Type: gboolean

TRUE if hdrs contains a “Content-Disposition” header, FALSE if not (in which case disposition and params will be unchanged).