# MultipartBodyOptions

Options when creating `MultipartBody`.

Used as argument in: [MultipartBody.fromRawBody](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.MultipartBody.html#fromrawbody)

- Source: [`aws-ec2/lib/user-data.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-ec2/lib/user-data.ts#L311)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const multipartBodyOptions: ec2.MultipartBodyOptions = {
  contentType: 'contentType',

  // the properties below are optional
  body: 'body',
  transferEncoding: 'transferEncoding',
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2

multipart_body_options = ec2.MultipartBodyOptions(
    content_type="contentType",

    # the properties below are optional
    body="body",
    transfer_encoding="transferEncoding"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;

MultipartBodyOptions multipartBodyOptions = MultipartBodyOptions.builder()
        .contentType("contentType")

        // the properties below are optional
        .body("body")
        .transferEncoding("transferEncoding")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;

var multipartBodyOptions = new MultipartBodyOptions {
    ContentType = "contentType",

    // the properties below are optional
    Body = "body",
    TransferEncoding = "transferEncoding"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

multipartBodyOptions := &MultipartBodyOptions{
	ContentType: jsii.String("contentType"),

	// the properties below are optional
	Body: jsii.String("body"),
	TransferEncoding: jsii.String("transferEncoding"),
}
```

## Properties

- `body`: string — The body of message.

  **Default:** undefined - body will not be added to part

- `contentType`: string (required) — `Content-Type` header of this part.

  Some examples of content types:
  * `text/x-shellscript; charset="utf-8"` (shell script)
  * `text/cloud-boothook; charset="utf-8"` (shell script executed during boot phase)

  For Linux shell scripts use `text/x-shellscript`.

- `transferEncoding`: string — `Content-Transfer-Encoding` header specifying part encoding.

  **Default:** undefined - body is not encoded
