How to intercept redirection from NSURLRequest without UIWebview
source link: https://www.codesd.com/item/how-to-intercept-redirection-from-nsurlrequest-without-uiwebview.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How to intercept redirection from NSURLRequest without UIWebview
I have a method that created a NSURLRequest. If I load this NSURLRequest in a UIWebView, there are some redirections that I catch with - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
.
How can I intercept this redirections without load my request in a UIWebView ? (I do not want it at all)
Well, you have to tell us how you're loading it to begin with. Are you using NSURLConnection
? Then use the -connection:willSendRequest:redirectResponse:
delegate method. Be sure to read the docs to understand when it will be called. It is often called just because the framework tweaked your request, before actually communicating with anything, so not every invocation is a redirect.
Related Articles
How do I redirect from & ldquo; domain.com/index.php? Subdomain = subdomain & rdquo; to & ldquo; subdomain.domain.com & rdquo; using .htaccess?
How do I redirect from Observer to Magento
How to secure $ _POST from PHP without making quotes and other things
How to get text from JSON without [& ldquo; & quot;]
How can I redirect to PHP without header error?
How to get tweets from Twitter without signing in to Twitter
How can I redirect from a page that no longer exists Rails 4
In Apache, how can I redirect from a specific path and query string?
How can I redirect from one domain to another in the django application?
How to delete seconds from Time without using TimeToStr (const datetime: TODateTime; const format parameters: TFormatSettings)
How to exclude properties from serialization without changing the class?
How to rewrite / redirect from http to https in Go?
How do I redirect from Apache to Tomcat?
How to always redirect from base / to a specific path in Angular2
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK