The LogYourRun app uses both UIWebView and NSURLRequest to communicate with the LogYourRun database. To let users upload and access their data. These requests often contain fields that the user enter such as running notes, distance, time etc. I had the WebKitErrorDomain 101 error come up on occasions when users tried to send requests that contained spaces that were not properly encoded. I was not able to find any documentation on this error so it took a while to figure out what was going on.
Once I identified that the issue was that some users had a space in their username it is a very easy fix. Just use the stringByAddingPercentEscapesUsingEncoding function to have the string properly encoded:
[username stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding];
So if you come along a WebKitErrorDomain 101 error – take a look at the URL you are trying to submit and see if all the parts of it are properly encoded.
