I have a HTML page that contains a form with a submit button like the following:
<form action="https://www.myUrl.com/test.html" method="POST">
<input class="submit" type="submit" title="PDF (165 KB)" value="PDF (165 KB)">
</form>
When clicking on the submit button from a desktop, a PDF file is downloaded. However, when clicking the same button in the Android WebView, the same PDF file is not being downloaded.
When requesting the Url after clicking the same button, I'm always getting text/html
as Content-Type
I tried requesting the url with different methods:
HttpUrlConnection:
ucon.setRequestProperty("User-Agent", params[1]); ucon.setRequestMethod(params[2]); ucon.connect(); String resource = ucon.getContentType();
- This answer
- An injected OkHttpClient
All three methods are returning the same Content-Type. Any Ideas?