nsurlprotocol

Why is there no NSHTTPURLProtocol class?

Well, NSURLProtocol is pretty generic right? It is for defining all kinds of protocols, isn't it? So why is there nothing like NSHTTPURLProtocol? Instead, there is an informal category on NSURLRequest with specific HTTP stuff. Why did they do that this way? Why no custom HTTP protocol instead? What's the idea behind putting all this st...

problem with custom NSProtocol and caching on iPhone

My iPhone app embeds a UIWebView which loads html via a custom NSProtocol handler I have registered. My problem is that resources referenced in the returned html, which are also loaded via my custom protocol handler, are cached and never reloaded. In particular, my stylesheet is cached: <link rel="stylesheet" type="text/css" hre...

Map Custom URL protocol to HTTP (using NSURLProtocol?)

I have an application using a WebKit WebView and I'd like to map URL's that are loaded in this WebView with a custom URL protocol to a different HTTP URL. For example, say I am loading: custom://path/to/resource I would like to internally actually load: http://something-else.com/path/to/resource In other words, the custom protocol se...

Custom URL protocol in Windows to serve HTML content

This question addresses how to register a custom URL protocol to launch an application in response to a link, but I want my handler to serve dynamic content. Essentially, I'm looking to create a web application that runs on the user's machine instead of a web server. I could set up a localhost, but I want to use a "friendly" URL format...

How to get requesting UIWebView from inside of NSURLProtocol

My app uses subclassing of NSURLProtocol. There are several UIWebViews in the app and for specific algorithm implemented in NSURLProtocol I need to know which one of the UIWebViews sends the request. My understanding is that object returned by [self client] should be somewhat connected with requesting object. But neither NSURLProtocolCl...

Passing data to objective c with POST rather than GET.

I have been using the url intercept method to pass data from javascript to objective C by passing the data as url encoded parameters and using NSURLProtocol to intercept the request however I am now wanting to send larger amounts of data like say 10,000 character long strings but this does not seem practical to do in a GET request. Righ...