NSMutableUrlRequest eats plus signs
- by Mike
I create NSMutableUrlRequest for sending data to server, add all necessary fields to it and then add the string for sending like this:
[theRequest setHTTPBody:[postString dataUsingEncoding: NSUTF8StringEncoding]];
postString is a usual NSString.
The problem is, when I receive this request at the server, all the plus (+) signs disappear from the http body. So if I had "abcde+fghj" on iPhone, I get "abcde fghj" on the server".
Can this be some encoding problem from using dataUsingEncoding: NSUTF8StringEncoding? Or some NSMutableUrlRequest stripping feature? What can I do to make it stop stripping plus signs? I need to receive UTF8 strings at the server side.