NSURLProtocol + WebView = Not able to get Data of HTTP post

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?

链接地址: http://www.djcxy.com/p/34802.html

上一篇: UIWebView使用NSUrlProtocol Xamarin.Forms缓慢加载

下一篇: NSURLProtocol + WebView =无法获取HTTP post的数据