Soup.ContentSniffer.sniff

### Method

# Soup ContentSniffersniff

#### Declaration [src]

    char*
    soup_content_sniffer_sniff (
      SoupContentSniffer* sniffer,
      SoupMessage* msg,
      GBytes* buffer,
      GHashTable** params
    )

#### Description [src]

Sniffs `buffer` to determine its Content-Type.

The result may also be influenced by the Content-Type declared in `msg`‘s response headers.

#### Parameters

`msg`

  Type: `SoupMessage`

  The message to sniff.

  The data is owned by the caller of the method.

`buffer`

  Type: `GBytes`

  A buffer containing the start of `msg`‘s response body.

  The data is owned by the caller of the method.

`params`

  Type: `GHashTable`

  Return location for Content-Type parameters (eg, “charset”), or `NULL`.

  The argument will be set by the function.
  The argument can be set to `NULL` by the method.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.

#### Return value

Type: `char*`

The sniffed Content-Type of `buffer`; this will never be `NULL`, but may be `application/octet-stream`.

The caller of the method takes ownership of the returned data, and is responsible for freeing it.
The value is a NUL terminated UTF-8 string.