Skip to content
Andrew Lambert edited this page May 20, 2015 · 22 revisions

This example sends an HTTP POST request containing a custom HTTP header field, and a multipart/form-data form with two string elements and one file element.

Dim cURL As New libcURL.cURLItem
Dim form As New libcURL.Form
Dim headers As New libcURL.curl_slist
Call headers.Append("X-Custom-Header: CustomValue")
Call form.AddElement("Test1", "TestValue1")
Call form.AddElement("Test2", "TestValue2")
Dim f As FolderItem = GetOpenFolderItem("")
Call form.AddElement("file", f)
Call cURL.SetOption(libcURL.Opts.HTTPPOST, form)
Call cURL.SetOption(libcURL.Opts.HTTPHEADER, headers)
Call cURL.Perform("http://www.example.com/formsubmit.php", 5)
cURL.Close
Clone this wiki locally