C# Class CurlSharp.CurlHttpMultiPartForm

Wraps a section of multipart form data to be submitted via the CurlOption.HttpPost option in the CurlEasy.SetOpt member of the CurlEasy class.
Inheritance: IDisposable
Show file Open project: WarlaxZ/Jackett Class Usage Examples

Public Methods

Method Description
AddSection ( ) : CurlFormCode

Add a multi-part form section.

This is definitely the workhorse method for this class. It should be called in roughly the same manner as curl_formadd(), except you would omit the first two struct curl_httppost** arguments (firstitem and lastitem), which are wrapped in this class. So you should pass arguments in the following sequence:

CurlHttpMultiPartForm.AddSection(option1, value1, ..., optionX, valueX, CurlFormOption.End) ;

For a complete list of possible options, see the documentation for the CurlFormOption enumeration.

The pointer options (PtrName, etc.) make an internal copy of the passed byte array. Therefore, any changes you make to the client copy of this array AFTER calling this method, won't be reflected internally with cURL. The purpose of providing the pointer options is to support the posting of non-string binary data.
CurlHttpMultiPartForm ( ) : System

Constructor

Dispose ( ) : void

Free unmanaged resources.

Private Methods

Method Description
Dispose ( bool disposing ) : void
GetHandle ( ) : IntPtr

Method Details

AddSection() public method

Add a multi-part form section.
This is definitely the workhorse method for this class. It should be called in roughly the same manner as curl_formadd(), except you would omit the first two struct curl_httppost** arguments (firstitem and lastitem), which are wrapped in this class. So you should pass arguments in the following sequence:

CurlHttpMultiPartForm.AddSection(option1, value1, ..., optionX, valueX, CurlFormOption.End) ;

For a complete list of possible options, see the documentation for the CurlFormOption enumeration.

The pointer options (PtrName, etc.) make an internal copy of the passed byte array. Therefore, any changes you make to the client copy of this array AFTER calling this method, won't be reflected internally with cURL. The purpose of providing the pointer options is to support the posting of non-string binary data.
public AddSection ( ) : CurlFormCode
return CurlFormCode

CurlHttpMultiPartForm() public method

Constructor
/// This is thrown /// if hasn't bee properly initialized. ///
public CurlHttpMultiPartForm ( ) : System
return System

Dispose() public method

Free unmanaged resources.
public Dispose ( ) : void
return void