I have the web application where the frontend is in ExtJS
and backend is in PHP
.
The forms are build in Extjs and its making PUT and POST request to server for saving data.
The josn data is posted like this
{"id":"101","description":"user1","active":true}
Now for debugging i would like to directly call this URL
in browser
so that i can use var_dump
for helpful messages.
As the request is AJAX by Extjs , so its very difficult to see messages through firebug.
Is there any way to make this request from browser and see response in rendred html.
I don't want to make form.
Right click on JSON file, select open, navigate to program you want open with(notepad). Consecutive opens automatically use notepad.
To post data in JSON format using JavaScript/jQuery, you need to stringify your JavaScript object using the JSON. stringify() method and provide a Content-Type: application/json header with your request. Below is an example of sending JSON data using jQuery.
You cannot make a POST request by using a web browser, as web browsers only directly support GET requests. For this example, we assume that you have installed a REST client browser plugin. Chrome and Firefox both support open source Rest Client plugins that allow for the invocation of REST APIs from the browser.
To send the JSON with payload to the REST API endpoint, you need to enclose the JSON data in the body of the HTTP request and indicate the data type of the request body with the "Content-Type: application/json" request header.
If you are using Google Chrome you can use the Postman Extension. It allows you to send pretty much any type of data and see the results.
For firefox you can use restclient plugin. Its also very easy to use, and userfriendly.
Also, if you know curl, you can do it programatically from PHP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With