[ad_1]
I wish to create physique like on this curl instance:
curl --location --request POST 'https://request.url'
--header 'Authorization: Bearer xxx'
--form 'title="Title"'
--form 'information="[{"text": "This is comment", "another": "Thomas"}]"'
How can I implement this and accurately set httpBody in URLRequest?
I attempted completely different approaches however nothing appears to work. Easy:
let physique = NSMutableData()
physique.appendString("title=" request.title))
physique.appendString("information=" + "[{"text": "This is comment", "another": "Thomas" }]"))
return Information(physique)
Then I attempted to prepand: "Content material-Disposition: form-data;". Or added line breakers. Nothing appears to be working.
That strains of code are a part of class that helps me work with requests. What is the easiest approach to get it working? Thanks for assist
[ad_2]
