<!--
{
  "availability" : [
    "iOS: 6.0.0 -",
    "iPadOS: 6.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.8.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Social",
  "identifier" : "/documentation/Social/SLRequest/addMultipartData(_:withName:type:filename:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Social"
    ],
    "preciseIdentifier" : "c:objc(cs)SLRequest(im)addMultipartData:withName:type:filename:"
  },
  "title" : "addMultipartData(_:withName:type:filename:)"
}
-->

# addMultipartData(_:withName:type:filename:)

Specifies a named multipart POST body for this request.

```
func addMultipartData(_ data: Data!, withName name: String!, type: String!, filename: String!)
```

## Parameters

`data`

The data for the multipart POST body, such as an image or text.

`name`

The name of the multipart POST body. This is the name that a specific social service expects.

`type`

The type of the multipart POST body. This is the MIME content type of the multipart data.

`filename`

The filename of the attachment that you want to POST. Many social services require a filename in order to accept certain POST requests, such as uploading an image or video. If your multipart data does not require a filename, pass in `nil`.

## Discussion

Possible parameter values are dependent on the target service. This information, as well as guidance on when to use a multipart POST body, is documented by the service provider. For links to documentation for the supported services, see Table 1 in [`SLRequest`](/documentation/Social/SLRequest).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)