---
name: "ne_get_content_type"
section: "3"
platform: "linux"
package: "neon"
version: "0.37.1-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/ne_get_content_type"
---

# ne\_get\_content\_type(3)

retrieve content type of response

## NAME

ne\_get\_content\_type - retrieve content type of response

## SYNOPSIS

```
#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***);**

## DESCRIPTION

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.

## 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\]).

## SEE ALSO

**ne\_xml\_dispatch\_request**(3), [**ne\_request\_dispatch**(3)](/ne_request_dispatch/3.md)

## COPYRIGHT

Copyright © 2001-2026 Joe Orton\

## REFERENCES

- 1\.

  RFC 7303

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