I want to create the body of POST method with
Content-Type: application/x-www-form-urlencoded
I'have got a dictionary
let params = ["key":"val","key1":"val1"]
I've tried to convert and escape dictionary using URLComponents
. But have not found in the HTTP specifications those escape methods are the same.
Does somebody know a correct solution to do this?
I've looked at
https://datatracker.ietf.org/doc/html/draft-hoehrmann-urlencoded-01
https://www.rfc-editor.org/rfc/rfc1866