Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Sealed class: RT.Util.MultipartFormDataHelper

Summary

Simplifies submitting POST requests with data encoded in the multipart/form-data format. See Remarks.

Remarks

The simplest use example is to create a web request using (HttpWebRequest) WebRequest.Create(...), add the data using MultipartFormDataHelper.AddField(string, string) and MultipartFormDataHelper.AddFile(string, string, string) methods, and complete the request using MultipartFormDataHelper.GetResponse().

Constructors

MultipartFormDataHelper(HttpWebRequest request)
Constructor.

Instance methods

void
AddField(string name, string value)
Adds a named text value to the POST request.
MultipartFormDataHelper.MultipartFileStream
AddFile(string name, string filename, string contentType = "application/octet-stream")
Adds a named file (or, generally, a binary data field) to the POST request.
void
AddFile(string name, string filename, byte[] data, string contentType = "application/octet-stream")
HttpWebResponse Finalizes the request and sends it to the remote host (or, if the request is not buffered, ensures the entire request has been sent). Waits for response and returns the response object.

Nested types

Encapsulates a stream used for writing a file body into a multipart/form-data stream. (see also remarks)