Skip to content
Andrew Lambert edited this page Jan 14, 2023 · 28 revisions

libcURL.ListPtr

Class Declaration

 Protected Class ListPtr
 Inherits libcURL.cURLHandle

Remarks

This class represents a singly-linked list of strings that is managed by libcURL. It is used by libcURL to represent such things as headers, cookie lists, FTP command sequences, and more. Use the Append method to add a string to the list.

Once the list is constructed you can pass it to the EasyHandle.SetOption method.

e.g. this sets some HTTP headers for an EasyHandle:

Dim headers As New libcURL.ListPtr
headers.Append("X-Hello: World")
headers.Append("X-Goodbye: Cruel World")
Dim curlget As New libcURL.EasyHandle
Call curlget.SetOption(libcURL.Opts.HTTPHEADER, headers)
Call curlget.Perform("http://www.example.com/", 5)

The memory backing the ListPtr is allocated and owned by libcURL, but tied to the lifetime of the ListPtr object. Once the ListPtr is destroyed the memory is freed: you must maintain a reference to a ListPtr object for the entire duration of all associated transfers. If the object is destroyed while libcURL is still using the memory then the application will crash hard.

Methods

See also

Clone this wiki locally