in Android WebView.
I am trying to use WebView # postUrl () with postData. but I could not find a way to change the Content-Type of the request. it is always "application / x-www-form-urlencoded".
How to change this?
StringBuilder sb = new StringBuilder(); sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n"); sb.append("<resource>\r\n"); sb.append("<element a=\"a\" b=\"b\"/>\r\n"); sb.append("</resource>"); String postData = sb.toString(); mWebView.postUrl(url, postData.getBytes());
Thanks!
source share