Sortix main manual
This manual documents Sortix main. You can instead view this document in the latest official manual.
curl_easy_header(3) | libcurl Manual | curl_easy_header(3) |
NAME
curl_easy_header - get an HTTP headerSYNOPSIS
#include <curl/curl.h>
CURLHcode curl_easy_header(CURL *easy,
const char *name,
size_t index,
unsigned int origin,
int request,
struct curl_header **hout);
DESCRIPTION
curl_easy_header(3) returns a pointer to a "curl_header" struct in hout with data for the HTTP response header name. The case insensitive nul-terminated header name should be specified without colon.The header struct
struct curl_header {
char *name;
char *value;
size_t amount;
size_t index;
unsigned int origin;
void *anchor;
};
ORIGINS
- CURLH_HEADER
- The header arrived as a header from the server.
- CURLH_TRAILER
- The header arrived as a trailer. A header that arrives after the body.
- CURLH_CONNECT
- The header arrived in a CONNECT response. A CONNECT request is being done to setup a transfer "through" an HTTP(S) proxy.
- CURLH_1XX
- The header arrived in an HTTP 1xx response. A 1xx response is an "intermediate" response that might happen before the "real" response.
- CURLH_PSUEDO
- The header is an HTTP/2 or HTTP/3 pseudo header
EXAMPLE
struct curl_header *type;
CURLHcode h =
curl_easy_header(easy, "Content-Type", 0, CURLH_HEADER, -1, &type);
AVAILABILITY
Added in 7.83.0. Officially supported since 7.84.0.RETURN VALUE
This function returns a CURLHcode indicating success or error.- CURLHE_BADINDEX (1)
- There is no header with the requested index.
- CURLHE_MISSING (2)
- No such header exists.
- CURLHE_NOHEADERS (3)
- No headers at all have been recorded.
- CURLHE_NOREQUEST (4)
- There was no such request number.
- CURLHE_OUT_OF_MEMORY (5)
- Out of resources
- CURLHE_BAD_ARGUMENT (6)
- One or more of the given arguments are bad.
- CURLHE_NOT_BUILT_IN (7)
- HTTP or the header API has been disabled in the build.
SEE ALSO
curl_easy_nextheader(3), curl_easy_perform(3), CURLOPT_HEADERFUNCTION(3), CURLINFO_CONTENT_TYPE(3)May 17, 2022 | libcurl 7.84.0 |