I've written a custom subclass of NSURLProtocol, however it seems that whenever I use the protocol to load a request in UIWebView it assumes the data is content-type "text/html". Is there a way to specify that this content is actually something else (For instance "text/plain" or "image/png")?
How do you change the content-type of a custom NSURLProtocol?
1.2k views Asked by BadPirate At
2
The content-type is actually carried by NSURLResponse, which you can modify by using the NSURLProtocolClient method URLProtocol:didReceiveResponse:cacheStoragePolicy: for instance, to set to text/plain