I understand this is not conventional way but i am bound by client.
what is the cUrl equivalent to
Expected
curl -v -X POST -H "Authorization: Basic XXXX==" -d Rules='[{\"some\":\"thing\"}]' "xyz.com/rules"
Focusing on a Rules
Field inside -d
Using
struct Parameters: Encodable {
let Rules: [ [String : String] ]
}
Session().request(
"xyz.com",
method: .post,
parameters: Parameters(),
encoder: JSONEncoder()
).cURLDescription { description in
print("cURLDescription: ", description)
}
This will result into
Present
curl -v -X POST -H "Authorization: Basic XXXX==" -d '{"Rules":"[{\"some\": \"thing\"}]}' "xyz.com/rules"
But this is not what is expected, need something which produces the above Expected
cUrl command