# MultipartFormDataSection

> A raw data section with a section name and a Content-Type header.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEngine.Networking](/engine/6000.5/script-reference/unityengine/networking.md)
* **Assembly:** UnityEngine.UnityWebRequestModule

## MultipartFormDataSection(string, byte\[], string)

A raw data section with a section name and a `Content-Type` header.

```csharp
public MultipartFormDataSection(string name, byte[] data, string contentType)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Section name.**** (\[byte\[]]\(https\://learn.microsoft.com/dotnet/api/system.byte)): Data payload of this section.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The value for this section's `Content-Type` header.

## MultipartFormDataSection(string, byte\[])

Raw data section with a section name, no `Content-Type` header.

```csharp
public MultipartFormDataSection(string name, byte[] data)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Section name.**** (\[byte\[]]\(https\://learn.microsoft.com/dotnet/api/system.byte)): 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.

```csharp
public MultipartFormDataSection(byte[] data)
```

### Parameters

**** (\[byte\[]]\(https\://learn.microsoft.com/dotnet/api/system.byte)): 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.

```csharp
public MultipartFormDataSection(string name, string data, Encoding encoding, string contentType)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Section name.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): String data payload for this section.**** (\[Encoding]\(https\://learn.microsoft.com/dotnet/api/system.text.encoding)): An encoding to marshal `data` to or from raw bytes.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): 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.

```csharp
public MultipartFormDataSection(string name, string data, string contentType)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Section name.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): String data payload for this section.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): 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`.

```csharp
public MultipartFormDataSection(string name, string data)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Section name.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): 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`.

```csharp
public MultipartFormDataSection(string data)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): String data payload for this section.

### Remarks

Identical to the above, but without a section name.
