I am working on converting a custom Objective-C Networking manager that I wrote for a client into Swift, as a way to learn the language and familiarize myself with the docs.
NSData *postData = [NSJSONSerialization dataWithJSONObject:userData options:0 error:&error];
[request setHTTPBody:postData];
However, when I open up the apple docs regarding setHTTPBody, it says it is no longer supported past 7.1?
In Swift, I have
/*Other Code*/
var request = NSMutableURLRequest(URL: sampleUrl)
request.addValue("Content-Type", forHTTPHeaderField: "application/json")
I would assume a function along the lines of
request.setHTTPBody("data")
However - this does not seem to be the case... am I missing something? Or is there a new function to take the place of this deprecated one?