Skip to content

libcURL.EasyHandle.SetRequestHeader

Andrew Lambert edited this page Aug 31, 2015 · 19 revisions

#libcURL.EasyHandle.SetRequestHeader

##Method Signature

 Function SetRequestHeader(Optional List As libcURL.ListPtr, Name As String, Value As String) As libcURL.ListPtr

##Parameters

Name Type Comment
List ListPtr Optional. The return value from a previous call to this method
Name String The header name. Pass an empty string to clear all previously set headers
Value String The header value. Pass an empty string to clear the named header

##Return value A ListPtr which represents all the headers added so far. Pass this value back to this method as List to append the next header.

##Notes Subsequent calls to this method will append the headers to the List parameter. 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.

If Name is "" (empty string), then any previously set headers will be cleared and this function returns Nil. The List may then be safely destroyed.

If List is not specified then a new List is returned.

##Syntax example

 Dim curl As New libcURL.EasyHandle
 Dim headers As libcURL.ListPtr
 headers = curl.SetRequestHeader("First", "Header") ' set header
 headers = curl.SetRequestHeader(headers, "Second", "Header") ' append header
 headers = curl.SetRequestHeader(headers, "First", "") ' clear header by name
 headers = curl.SetRequestHeader(headers, "", "") ' clear all headers

Clone this wiki locally