Skip to content

Supporting multiple multipart data #70

Description

@VikkyTheDev

How can I request with multiple multipart data. As i can see that existing methods doesn't seems to be providing this. Am I missing something?

In WS.Swift file
open func postMultipart(_ url: String,
params: Params = Params(),
name: String,
data: Data,
fileName: String,
mimeType: String) -> Promise {
let r = postMultipartRequest(url,
params: params,
name: name,
data: data,
fileName: fileName,
mimeType: mimeType)
return r.fetch().resolveOnMainThread()
}

and request in WS+Requests.swift

public func postMultipartRequest(_ url: String,
params: Params = Params(),
name: String,
data: Data,
fileName: String,
mimeType: String) -> WSRequest {
let c = call(url, verb: .post, params: params)
c.isMultipart = true
c.multipartData = data
c.multipartName = name
c.multipartFileName = fileName
c.multipartMimeType = mimeType
return c
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions