W
W
Wakim2016-11-19 01:28:19
Android
Wakim, 2016-11-19 01:28:19

Why, after authorization on the site through webView, the page redirected by redirect is not loaded?

I made a software that logs in to the site of the office with which I am not connected in any way, for authorization, a POST request to the url https://yyy.yyy.ru is used.
To work with the site, I use webView, authorization is normal, but then a page opens with the following text:
{"returnUrl":"http ://xxx.xxx.ru","forceRedirect":false} and then nothing happens.
If the application makes a webView.loadUrl request with a call to this second address "http://xxx.xxx.ru" immediately after the first request, then the required page with authorized access is opened.
Accordingly, the question is how to make it so that after the first call https://yyy.yyy.ruwould the second page http://xxx.xxx.ru immediately open in webView without the need to manually call webView.loadUrl with a new address?
Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rou1997, 2016-11-19
@Rou1997

That is, you have a POST request, and you send it from to the WebView using loadUrl?
Be glad that authorization works at all, because you get to do GET instead of POST, this is just barbaric!
Since the output is JSON, then apparently this is an AJAX request, well, or the server considers it to be so, the WebView itself will not process it in any way, you decide, either send HTTP requests by sending HTTP requests, or use the browser as a browser, and don’t invent all sorts of "hybrid hedgehogs with snakes."

W
Wakim, 2016-11-19
@Wakim

I don't send a post via load, I authorize a post request (webView.postUrl) and it succeeds, and then a page with information about the redirect is displayed and everything stops. I want the webView to automatically open the page where it was redirected after authorization.
Please read the question carefully and to the end.
Thank you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question