Android WebView Post Request with Custom Headers

后端 未结 2 586
攒了一身酷
攒了一身酷 2021-02-19 05:36

I could see there are two separate methods in Android docs to post the data and add the headers.

For setting Headers
public void loadUrl (String url, Map

        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-19 06:03

    It seems that the framework does not provide these features together.

    Looking at the source code of WebViewCore (https://android.googlesource.com/platform/frameworks/base/+/eclair-release%5E2/core/java/android/webkit/WebViewCore.java, line 889), additional headers are processed only in the loadUrl call and never in the postUrl.

提交回复
热议问题