1

I have created a scaled down version of my own browser using WebView + NSURLProtocol. I took the sample code from following blog to get started.

http://www.raywenderlich.com/59982/nsurlprotocol-tutorial ( To download the code, go to heading "Where to go from here")

After I intercept the http request using NSURLProtocol, I do not use NSURLConnection or NSURLSession, rather I use some 3rd party library to make HTTP request.

Problem is when I am making HTTP-Post request in WebView. I need the Body Data, Form data or data stream in case of uploads etc so that i can pass o nthe same to my 3rd party library.

When the control comes in startLoading() request.HTTPBody and request.HTTPBodyStream should give the data. When I am printing them its printed as nil.

Some people in request below also reported the same problem.

Using a custom NSURLProtocol with UIWebView and POST requests

Is that NSURLProtocol implementation is incomplete or its the bug with NSURL protocol or WebView?

Community
  • 1
  • 1
iOSMonkey
  • 119
  • 1
  • 1
  • 9
  • This question can be closed. there was some error in canInitMethod due to which it was not intercepting http request itself. My bad. please remove this question. – iOSMonkey Nov 10 '14 at 17:42

0 Answers0