Skip to content

libcURL.MultipartForm.Serialize

Andrew Lambert edited this page Sep 15, 2015 · 20 revisions

#libcURL.MultipartForm.Serialize

##Method Signatures

 Function Serialize() As String
 Function Serialize(WriteTo As Writeable) As Boolean

##Parameters ###Serialize(Writeable)

Name Type Comment
WriteTo Writeable The serialized form will be written to this object.

##Return value ###Serialize() A serialized representation of the form.

###Serialize(Writeable) If True the operation succeeded. Otherwise, check MultipartForm.LastError for details.

##Remarks 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.

##Example

  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--

##See also

Clone this wiki locally