You need to implement UIWebViewDelegate. There is a hook called "shouldStartLoadWithRequest" that is called by iOS.
Pseudocode below.
@interface MyController<UIWebViewDelegate> @end @implementation MyController - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { // do your magic NSData *data = request.HTTPBody; // contains the HTTP body as in an HTTP POST request. // return YES to continue to load the URL } @end
source share