I'm using Alamofire to call .put method on an external API. In Postman I can successfully pass raw JSON data in the following format where each item contains an ID and a quantity. :
[{
"id":"176",
"quantity":"2"
}, {
"id":"178",
"quantity":"1"
}]
cURL example:
PUT /cart HTTP/1.1
Host: someapi.biz
x-api-key: somekey
x-auth-token: sometoken
Content-Type: application/json
cache-control: no-cache
Postman-Token: sometoken
[{
"id":"176",
"quantity":"2"
}, {
"id":"178",
"quantity":"1"
}]------WebKitFormBoundary7MA4YWxkTrZu0gW--
In swift I can't figure out how to format this information correctly into a set of Parameters for Alamofire.
for item in OrderedItems {
let rowItem: JSON = ["id" : item.ID, "quantity" : item.Quantity]
??
}