Latest 0.0.1
Homepage https://github.com/davbeck/MultipartForm
License MIT
Platforms ios 9.0, osx 10.10
Authors

A simple way to create multipart form requests in Swift.

Example

import MultipartForm

let form = MultipartForm(parts: [
    MultipartForm.Part(name: "a", value: "1"),
    MultipartForm.Part(name: "b", value: "2"),
    MultipartForm.Part(name: "c", data: imageData, filename: "3.png", contentType: "image/png"),
])

var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue(form.contentType, forHTTPHeaderField: "Content-Type")

let task = session.uploadTask(with: request, from: form.bodyData)
task.resume()

Latest podspec

{
    "name": "MultipartForm",
    "version": "0.0.1",
    "summary": "The missing multipart form support for URLSession.",
    "homepage": "https://github.com/davbeck/MultipartForm",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "davbeck": "[email protected]"
    },
    "source": {
        "git": "https://github.com/davbeck/MultipartForm.git",
        "tag": "0.0.1"
    },
    "social_media_url": "https://twitter.com/davbeck",
    "platforms": {
        "ios": "9.0",
        "osx": "10.10"
    },
    "swift_version": "4.2",
    "source_files": "Sources/MultipartForm/*.swift",
    "testspecs": [
        {
            "name": "MultipartFormTests",
            "test_type": "unit",
            "source_files": "Tests/MultipartFormTests/*"
        }
    ]
}

Pin It on Pinterest

Share This