-
-
Notifications
You must be signed in to change notification settings - Fork 11
libcURL.MultipartForm
libcURL.MultipartForm
Protected Class MultipartForm
Inherits libcURL.cURLHandle
This class represents an HTTP form that will be encoded using the multipart/form-data
format.
Form elements are stored as a (read only) list of form elements.
Use the AddElement method to add an element to the form. Form elements contents may be either a String, a MemoryBlock, a FolderItem, an array of FolderItems, or an object which implements the Readable
interface.
Once the MultipartForm is constructed you can pass it to the EasyHandle.SetFormData method, or to the EasyHandle.SetOption method using libcURL.Opts.HTTPPOST
as the option number.
e.g.
Dim frm As New libcURL.MultipartForm
frm.AddElement("username", "Bob")
frm.AddElement("fileupload", SpecialFolder.Desktop.Child("foo.bin"))
Dim curl As New libcURL.EasyHandle
Call curl.SetOption(libcURL.Opts.HTTPPOST, frm)
Call curl.Perform("http://www.example.com/submit.php", 5)
You may also convert a Dictionary into a new MultipartForm. If you pass a Dictionary to a method that expects a MultipartForm (for example, cURLClient.Post), then the Dictionary will be converted automatically.
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.