Saturday, 15 January 2011

debugging - How to debug a page receiving an Ajax POST request? -


How can I debug a page that receives Ajax Post Request? For the page that receives a GET request, I will simply enter the URL manually, like:
http: //localhost/.../myAjaxPage.php? ParamName1 = paramValue1 and paramName2 = paramValue2

In this page, I have to make sure that var_dumps or echo is required This should work.

How can I get a post request with that page?

You curl to make a post request from the command line

Chrome Developer Tools, in the Networks tab, when you right-click on the XHR request entry, "Copy as curl" is the option, it gives you the curl command which is POST , Replaces the request with all the headers, cookies, etc.

You can also inspect the inspector's reaction, if you can not add the debug information to the feedback, then you can add it to custom HTTP header ( & lt ;? php header (" X-my-debug: $ stuff "), you must add ob_start () at the beginning of the script)

No comments:

Post a Comment