API Overview
POSTing with curl's -F option will make it include a default Content-Type header in its request, as shown in the above example. This says multipart/form-data and then specifies the MIME boundary string. That content-type is the default for multipart formposts but you can, of course, still modify that for your own commands and if you do, curl is clever enough to still append the boundary magic. CURLcode curleasygetinfo(CURL.handle, CURLINFOCONTENTTYPE, char.ct); DESCRIPTION. Pass a pointer to a char pointer to receive the content-type of the downloaded object. This is the value read from the Content-Type: field. If you get NULL, it means that the server didn't send a valid Content-Type header or that the protocol used doesn't.
Docs
Functions
curl / libcurl / API / curl_easy_getinfo / CURLINFO_CONTENT_TYPE
Related:
info options
easy options
multi options
API overview
File a bug about this page
View man page source
info options
easy options
multi options
API overview
File a bug about this page
View man page source
NAME
CURLINFO_CONTENT_TYPE - get Content-Type
SYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CONTENT_TYPE, char **ct);
Curl Content Type Binary
DESCRIPTION
Pass a pointer to a char pointer to receive the content-type of the downloaded object. This is the value read from the Content-Type: field. If you get NULL, it means that the server didn't send a valid Content-Type header or that the protocol used doesn't support this.
The ct pointer will be NULL or pointing to private memory you MUST NOT free it - it gets freed when you call curl_easy_cleanup on the corresponding CURL handle.
PROTOCOLS
HTTP(S)
EXAMPLE
AVAILABILITY
Curl Content Type Csv
Added in 7.9.4
RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
SEE ALSO
Curl Content Type Form Data
curl_easy_getinfo(3), curl_easy_setopt(3),
Curl Content Type Json
This HTML page was made with roffit.