ne_get_content_type(3)

ne_get_content_type3

Retrieve content type of response

Usage

#include <ne_basic.h>
typedef struct {
    const char *type, *subtype;
    const char *charset;
    char *value;
} ne_content_type;

int ne_get_content_type(ne_request *req, ne_content_type *ctype);

Overview

The ne_get_content_type function retrieves and parses the Content-Type header from the response to request req. If successful, all fields of the ctype structure are set (and are never NULL). The value field must be freed by the caller using free after use.

Return value

ne_get_content_type returns zero if the response had a valid Content-Type header, or non-zero on error. On error, the ctype structure is not altered.

References

1.

RFC 7303

https://www.rfc-editor.org/rfc/rfc7303

History

A default charset value was returned for text/xml content-types in neon 0.36.0 and earlier; later versions use no default (per RFC 7303[1]).

From neon 0.37.1-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.