Created
October 3, 2014 20:48
-
-
Save rad3ks/db9d51881a806b55fcf5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (parameters) { | |
if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) { | |
NSString *charset = (__bridge NSString *)CFStringConvertEncodingToIANACharSetName(CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding)); | |
[mutableRequest setValue:[NSString stringWithFormat:@"application/json; charset=%@", charset] forHTTPHeaderField:@"Content-Type"]; | |
} | |
[mutableRequest setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:self.writingOptions error:error]]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment