0

I have seen all sorts of questions about modifying NSURLRequest but not NSHTTPURLResponse. Our scenario is that:

  1. A web page that is loaded in a UIWebview will make an HTTP request. This is typically a form post in a hidden iFrame or AJAX request. All that we can control is the host name of the request. We cannot modify anything else in the webpage.
  2. In the UIWebviewDelegate the request is captured. We extract some data out of the request URL. That data is processed and a result is generated.
  3. Then I need to provide a custom NSHTTPURLResponse that includes the result from #2 to the web view.

This is similar to the basic functionality of a Java Servlet. I have not found any way of being able to achieve #3.

Also UIWebviewDelegate doesn't seem to capture AJAX requests. There doesn't seem to be any workaround without placing custom java script in the web page as outlined here: UIWebViewDelegate not monitoring XMLHttpRequest?

Community
  • 1
  • 1
user1910629
  • 81
  • 1
  • 6

0 Answers0