-
-
Notifications
You must be signed in to change notification settings - Fork 11
HTTP POST Example
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
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.