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