1👍
✅
You should probably add:
[request setValue:@"application/json; charset=UTF-8" forHTTPHeaderField:@"Content-Type"];
Then the server will know that what you’re sending is UTF-8 encoded JSON and it will be able to parse it appropriately. Otherwise it just gets a formless blob of data.
Unless it’s for debugging purposes, it’s very odd that you put the JSON string into both the header and the body.
Source:stackexchange.com