How can I get the JSON response of a POST request in a WebView?

You should override the shouldOverrideUrlLoading method of WebViewClient @Override public boolean shouldOverrideUrlLoading (WebView view, String url) { if(flag) { URL aURL = new URL(url); URLConnection conn = aURL.openConnection(); conn.connect(); InputStream is = conn.getInputStream(); // read inputstream to get the json.. … … return true; } return false } @override public void onPageFinished (WebView view, String … Read more

GET vs POST in AJAX?

You should use the proper HTTP verb according to what you require from your web service. When dealing with a Collection URI like: http://example.com/resources/ GET: List the members of the collection, complete with their member URIs for further navigation. For example, list all the cars for sale. PUT: Meaning defined as “replace the entire collection … Read more

PHP, pass array through POST

Edit If you are asking about security, see my addendum at the bottom Edit PHP has a serialize function provided for this specific purpose. Pass it an array, and it will give you a string representation of it. When you want to convert it back to an array, you just use the unserialize function. $data … Read more

Android – how to intercept a form POST in android WebViewClient on API level 4

This is known issue, that shouldOverrideUrlLoading don’t catch POST. See http://code.google.com/p/android/issues/detail?id=9122 for details. Use GET! I personally tried using POST, because I expected some limitation of GET parameters (i.e. length of URL), but I just successfully passed 32000 bytes through GET locally without any problems.

Textarea value not getting posted with form

try to put it inside the form tag as follows… it should work <form action=”sendConfirmation.php” name=”confirmationForm” method=”post”> <textarea id=”confirmationText” class=”text” cols=”86″ rows =”20″ name=”confirmationText”></textarea> <input type=”submit” value=”Email” class=”submitButton”> </form> however you can use the same approach as well but you need to provide the from id attribute then <form action=”sendConfirmation.php” id=”confirmationForm” method=”post”> <input type=”submit” value=”Email” … Read more

Avoid duplicate POSTs with REST

Another solution that’s been proposed for this is POST Once Exactly (POE), in which the server generates single-use POST URIs that, when used more than once, will cause the server to return a 405 response. The downsides are that 1) the POE draft was allowed to expire without any further progress on standardization, and thus … Read more

What does %5B and %5D in POST requests stand for?

As per this answer over here: str=”foo%20%5B12%5D” encodes foo [12]: %20 is space %22 is quotes %5B is ‘[‘ and %5D is ‘]’ This is called percent encoding and is used in encoding special characters in the url parameter values. EDIT By the way as I was reading https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/encodeURI#Description, it just occurred to me why … Read more