-
-
Notifications
You must be signed in to change notification settings - Fork 11
libcURL.MultipartForm.Serialize
Andrew Lambert edited this page Mar 16, 2017
·
20 revisions
libcURL.MultipartForm.Serialize
Function Serialize() As String
Function Serialize(WriteTo As Writeable) As Boolean
Name | Type | Comment |
---|---|---|
WriteTo | Writeable |
A serialized representation of the form will be written to this object. Pass Nil to raise the SerializePart event instead. |
A serialized representation of the form.
If True
the operation succeeded. Otherwise, check MultipartForm.LastError for details.
Serializes the form structure into a multipart/form-data string. The serialized form may be used with other HTTP libraries, including the built-in HTTPSocket. Serialization can be a slow operation, so it should be done sparingly.
Serialized forms can be reconstituted by using the Deserialize method.
Dim form As New libcURL.MultipartForm
Call form.AddElement("username", "Bob")
Call form.AddElement("password", "seekrit")
Dim formdata As String = form.Serialize
After running, the contents of the formdata
String will be:
Content-Type: multipart/form-data; boundary=------------------------82a03fc80fa35c1c
--------------------------82a03fc80fa35c1c
Content-Disposition: form-data; name="username"
Bob
--------------------------82a03fc80fa35c1c
Content-Disposition: form-data; name="password"
seekrit
--------------------------82a03fc80fa35c1c--
- curl_formget in the libcURL documentation.
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.