From 38d517fcd4ef9f00f1e320869840e6bec1f71596 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 18 Jun 2014 00:29:22 +0200 Subject: opts: 29 more options as man pages --- docs/libcurl/opts/CURLOPT_HTTPHEADER.3 | 78 ++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 docs/libcurl/opts/CURLOPT_HTTPHEADER.3 (limited to 'docs/libcurl/opts/CURLOPT_HTTPHEADER.3') diff --git a/docs/libcurl/opts/CURLOPT_HTTPHEADER.3 b/docs/libcurl/opts/CURLOPT_HTTPHEADER.3 new file mode 100644 index 000000000..557f9fbf0 --- /dev/null +++ b/docs/libcurl/opts/CURLOPT_HTTPHEADER.3 @@ -0,0 +1,78 @@ +.\" ************************************************************************** +.\" * _ _ ____ _ +.\" * Project ___| | | | _ \| | +.\" * / __| | | | |_) | | +.\" * | (__| |_| | _ <| |___ +.\" * \___|\___/|_| \_\_____| +.\" * +.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. +.\" * +.\" * This software is licensed as described in the file COPYING, which +.\" * you should have received as part of this distribution. The terms +.\" * are also available at http://curl.haxx.se/docs/copyright.html. +.\" * +.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell +.\" * copies of the Software, and permit persons to whom the Software is +.\" * furnished to do so, under the terms of the COPYING file. +.\" * +.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +.\" * KIND, either express or implied. +.\" * +.\" ************************************************************************** +.\" +.TH CURLOPT_HTTPHEADER 3 "17 Jun 2014" "libcurl 7.37.0" "curl_easy_setopt options" +.SH NAME +CURLOPT_HTTPHEADER \- set custom HTTP headers +.SH SYNOPSIS +#include + +CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HTTPHEADER, struct curl_slist *headers); +.SH DESCRIPTION +Pass a pointer to a linked list of HTTP headers to pass to the server and/or +proxy in your HTTP request. The same list can be used for both host and proxy +requests! + +The linked list should be a fully valid list of \fBstruct curl_slist\fP +structs properly filled in. Use \fIcurl_slist_append(3)\fP to create the list +and \fIcurl_slist_free_all(3)\fP to clean up an entire list. If you add a +header that is otherwise generated and used by libcurl internally, your added +one will be used instead. If you add a header with no content as in 'Accept:' +(no data on the right side of the colon), the internally used header will get +disabled. With this option you can add new headers, replace internal headers +and remove internal headers. To add a header with no content (nothing to the +right side of the colon), use the form 'MyHeader;' (note the ending +semicolon). + +The headers included in the linked list \fBmust not\fP be CRLF-terminated, +because libcurl adds CRLF after each header item. Failure to comply with this +will result in strange bugs because the server will most likely ignore part of +the headers you specified. + +The first line in a request (containing the method, usually a GET or POST) is +not a header and cannot be replaced using this option. Only the lines +following the request-line are headers. Adding this method line in this list +of headers will only cause your request to send an invalid header. Use +\fICURLOPT_CUSTOMREQUEST(3)\fP to change the method. + +Pass a NULL to this option to reset back to no custom headers. + +The most commonly replaced headers have "shortcuts" in the options +\fICURLOPT_COOKIE(3)\fP, \fICURLOPT_USERAGENT(3)\fP and +\fICURLOPT_REFERER(3)\fP. + +There's an alternative option that sets or replaces headers only for requests +that are sent with CONNECT to a proxy: \fICURLOPT_PROXYHEADER(3)\fP. Use +\fICURLOPT_HEADEROPT(3)\fP to control the behavior. +.SH DEFAULT +NULL +.SH PROTOCOLS +HTTP +.SH EXAMPLE +TODO +.SH AVAILABILITY +As long as HTTP is enabled +.SH RETURN VALUE +Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not. +.SH "SEE ALSO" +.BR CURLOPT_CUSTOMREQUEST "(3), " CURLOPT_HEADEROPT "(3), " +.BR CURLOPT_PROXYHEADER "(3)" -- cgit v1.2.3