Posts

Post not yet marked as solved
0 Replies
240 Views
The following code snippet does not work as expected: var request = URLRequest(url: url) request.setValue("application/json", forHTTPHeaderField: "Content-Type") request.httpBody = bodyData request.httpMethod = "POST" The code sends a GET request to a local server and since I have control of that server, I can see an error message as the server expects a POST rather than the GET. What do I need to change so that the above code actually performs a POST? Thanks in advance!
Posted Last updated
.