Latest 3.0.0-alpha3
License MIT
Platforms ios 9.0, requires ARC
Dependencies libCommonCrypto

Multipart Data Builder

Build Status
CocoaPods Compatible
Carthage Compatible

MultipartDataBuilder is a micro framework for creating multipart data forms, used for uploading files over HTTP.


MultipartDataBuilder provides a simple API for building fields, and an extension on NSMutableURLRequest for attaching the built form and sets the required header.

Creating the multipart form:

var builder = MultipartDataBuilder()

Posting a file:

  content: image,
  fileName: "photo.jpg",
  contentType: "image/jpeg")

Adding other form data:

builder.appendFormData("filter", value: "sepia")

Building the form:

request.setMultipartBody(, boundary: builder.boundary)



  1. Add github "mogstad/multipart_data_builder" ~> 2.0 to your “Cartfile”
  2. Run carthage update
  3. Link MultipartDataBuilder with your target
  4. Create a new “Copy files” build phases, set ”Destination” to ”Frameworks”, add MultipartDataBuilder


Update your podfile:

  1. Add use_frameworks! to your pod file1
  2. Add pod "MultipartDataBuilder", "~> 2.0" to your target
  3. Update your dependencies by running pod install

  1. Swift code can’t be included as a static library, therefor it’s required to add use_frameworks! to your podfile. It will then import your dependeices as dynamic frameworks. 

Latest podspec

    "name": "MultipartDataBuilder",
    "version": "3.0.0-alpha3",
    "license": "MIT",
    "summary": "Micro framework for creating multipart forms",
    "homepage": "",
    "authors": {
        "Bjarne Mogstad": "[email protected]"
    "source": {
        "git": "",
        "tag": "v3.0.0-alpha3"
    "platforms": {
        "ios": "9.0"
    "ios": {
        "frameworks": "MobileCoreServices"
    "dependencies": {
        "libCommonCrypto": [
            "~> 0.1"
    "source_files": [
    "requires_arc": true

Pin It on Pinterest

Share This