Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


MultipartFormDataSection

A raw data section with a section name and a Content-Type header.
Read time 2 minutesLast updated 6 days ago

Definition

MultipartFormDataSection(string, byte[], string)

A raw data section with a section name and a
Content-Type
header.
public MultipartFormDataSection(string name, byte[] data, string contentType)

Parameters

name

Section name.

data

Data payload of this section.

contentType

The value for this section's
Content-Type
header.

MultipartFormDataSection(string, byte[])

Raw data section with a section name, no
Content-Type
header.
public MultipartFormDataSection(string name, byte[] data)

Parameters

name

Section name.

data

Data payload of this section.

Remarks

Identical to the prior constructor, but with a section name included.

MultipartFormDataSection(byte[])

Raw data section, unnamed and no
Content-Type
header.
public MultipartFormDataSection(byte[] data)

Parameters

data

Data payload of this section.

Remarks

Will not include either a filename or a
Content-Type
section header.

MultipartFormDataSection(string, string, Encoding, string)

A named raw data section whose payload is derived from a string, with a
Content-Type
header.
public MultipartFormDataSection(string name, string data, Encoding encoding, string contentType)

Parameters

name

Section name.

data

String data payload for this section.

encoding

An encoding to marshal
data
to or from raw bytes.

contentType

The value for this section's
Content-Type
header.

Remarks

data will be encoded into raw bytes using
encoding
.

MultipartFormDataSection(string, string, string)

A named raw data section whose payload is derived from a UTF8 string, with a
Content-Type
header.
public MultipartFormDataSection(string name, string data, string contentType)

Parameters

name

Section name.

data

String data payload for this section.

contentType

The value for this section's
Content-Type
header.

Remarks

For UTF-8 strings with custom
Content-Type
headers, use this constructor. The data is returned in UTF-8 encoding and converted to raw bytes appropriately.

MultipartFormDataSection(string, string)

A names raw data section whose payload is derived from a UTF8 string, with a default
Content-Type
.
public MultipartFormDataSection(string name, string data)

Parameters

name

Section name.

data

String data payload for this section.

Remarks

For UTF8 strings, use this constructor.
data
will be assumed to be in UTF8 encoding and converted appropriately. The section will be assigned a
Content-Type
of
text/plain; encoding=utf8
.

MultipartFormDataSection(string)

An anonymous raw data section whose payload is derived from a UTF8 string, with a default
Content-Type
.
public MultipartFormDataSection(string data)

Parameters

data

String data payload for this section.

Remarks

Identical to the above, but without a section name.