-
-
Notifications
You must be signed in to change notification settings - Fork 11
libcURL.MultipartForm.Serialize
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.
Form elements whose value is a reference to a Readable object will only be read when the form is actually about to be sent to the server. As such, these elements will be empty if you call Serialize before the form is sent to a server.
Dim form As New libcURL.MultipartForm
form.AddElement("username", "Bob")
form.AddElement("password", "seekrit")
Dim formdata As String = form.SerializeAfter 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.