-
-
Notifications
You must be signed in to change notification settings - Fork 11
libcURL.EasyHandle.SetRequestHeader
libcURL.EasyHandle.SetRequestHeader
Function SetRequestHeader(Optional List As libcURL.ListPtr, Name As String, Value As String) As libcURL.ListPtr
Name | Type | Comment |
---|---|---|
List | ListPtr | Optional. If specified, the return value from a previous call to this method (or any existing list of headers.) |
Name | String | The header name. If the header already exists it will be replaced. Pass an empty string to clear all headers previously set by this function. |
Value | String | The header value. Pass an empty string to clear the named header |
A reference to a ListPtr which represents all the headers added so far. Pass this value back to this method as List
to append the next header. Returns Nil
if no headers exist.
This method updates the List
of headers that will be used in the next request. You must maintain a reference to the List
until it is no longer in use by libcURL. Pass the List
reference back to this function when adding subsequent headers. This pattern eases safe handling and disposal of the List
reference by making the caller responsible for maintaining the reference.
If the named header does not already exist then it is appended to the List
. If the header exists then the header is updated; if Value
is ""
(empty string) then the header is removed.
If Name
is ""
(empty string) then any previously set headers will be cleared, libcURL's default headers are reinstated, and this function returns Nil
. The List
may then be safely destroyed.
If List
is not specified (and Name<>""
) then a new List
is returned.
Dim curl As New libcURL.EasyHandle
Dim h As libcURL.ListPtr = curl.SetRequestHeader("First", "Header") ' set header
h = curl.SetRequestHeader(h, "Second", "Header") ' append header
h = curl.SetRequestHeader(h, "First", "") ' clear header by name
h = curl.SetRequestHeader(h, "", "") ' clear all headers
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2014-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.