0

I use Alamofire to send requests in my iOS App. For debugging, i want to see what the JSON Body looks like in raw. I expect it to look like:

{"receiverUserGroups":["testgroup"],"message":"testmessage"}

But I have not found a way to print it out in that format. I simply define the header and the params and make a request.

let headers: HTTPHeaders = [
        "sid": sid,
        "Content-Type": "application/json"
    ]

var params = [
        "receiverUserGroups":[""],
        "message": "testmessage"] as [String : Any]
params["receiverUserGroups"] = group

Alamofire.request(urlString, method: .post, parameters: params, encoding: JSONEncoding.default, headers: headers)

Is there a way to see what i am sending to the server? Thank you in advance!

Jochen Österreicher
  • 683
  • 2
  • 11
  • 25

0 Answers0