Android-the method loadUrl() in webView sends POST or GET request? - android

i'm working with webview recently and i found 2 methods to load an URL in webView.
For postUrl() the doc said clearly it sends a POST request, but it didn't say anything about loadUrl().
can anybody tell me anything about it?

Related

How to read body of a POST request into Android WebView

I have to submit a form to an external URL, that provides into my WebView a series of interaction with the user.
At the end of this process this external service does a redirect to my another URL (that is fake) through a POST call, sending some data that I need to show at the user.
I tried to catch this POST request into the method shouldInterceptRequest, because I have to read data before the load of my fake url starts, but the methods that I can use on a WebResourceRequest object are useless. There is nothing to read the body of this request.
There is another way to catch my data? Any suggestions?
(I already tried the writeinterception project library, but it doesn't work.)
Thanks a lot in advance.

Android intercept the response body and headers from a WebView?

I need to intercept the responses coming back from the response and redirects of a webview as it's loading?
I need to read the headers during the redirect, and I need to read cookies coming back.
Is this possible? Looking at some samples on stackoverflow, most solutions use shouldOverrideUrlLoading but that only gives you access to the url, and not the full response

Receive POST information from callback, Android WebView

My scenario is this: we point the user to a form where they fill in the data (3DSecure) and then POST, the website then POSTS the response to a callback URL - this response is what I want to capture. WebView.shouldInterceptRequest() can get the headers but not the content (Why, Google?). I tried this link and it can get the POST data that the user sends. Is there any way to use Javascript to catch the POST data being received to a callback of my choosing?
I saw this post from 5 years ago and the man resorted to POSTing the response back to a server and then getting the contents from the phone. This is far from ideal. Surely there's a newer solution?
shouldInterceptRequest() mentions that a response contains the "response information or null if the WebView should load the resource itself", how do I get it so that the WebView shouldn't load the resource itself? The source code seems to return null always.
I used this gentleman's library: https://github.com/LivotovLabs/3DSView
If one was looking to do this with something other than 3DSecure they could use it as a template.

Android WebView loadUrl after postUrl

I have a problem using loadUrl after postUrl.
First I use postUrl to login to a website and after that I want to load another page from the same website with loadUrl. But after using loadUrl Im asked again to login.
Probably you need to handle cookie with WebView.
You need to store the COOKIE returned by the POST request (i.e., the login request). Then, whenever you send a GET request, you need to pass along the cookie so the sever knows you've already logged in.

Intercepting POST in WebView using NDK

I am trying to intercept http POST method in WebView android, but not able to find any suitable method for the same. In API 11 there is a method shouldInterceptRequest, but it gives only webviewq and url as parameters so cater only GET request, it doesnot provide POST body data and request type indicator.
My question : Is there any way to override this method in android NDK ? or if i can pass a flag which identify request and also i can provide POST data.
Also if you have any other solution, tell me.

Categories

Resources