Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how postman REST Client raw json data is sent to server in POST, PUT calls?

I'm working on a application to test API calls, in which i'm able to generate URL for paramaters which is declared with annotation @Requestparam and @Pathvariable.

But when using @RequestBody we use raw in post man. I'm not sure how data is sent in raw. I just want to know how to send data in raw to server.

Any help is appreciated. Thanks in Advance.

I'm doing this as AJAX using Jquery.

like image 227
ram Avatar asked Sep 11 '13 10:09

ram


People also ask

How does Postman pass JSON in POST request?

POST requests In Postman, change the method next to the URL to 'POST', and under the 'Body' tab choose the 'raw' radio button and then 'JSON (application/json)' from the drop down. You can now type in the JSON you want to send along with the POST request. If this is successful, you should see the new data in your 'db.

How raw data is passed in Postman?

Raw data. You can use raw body data to send anything you can enter as text. Use the raw tab, and the type dropdown list to indicate the format of your data (Text, JavaScript, JSON, HTML, or XML) and Postman will enable syntax-highlighting as well as appending the relevant headers to your request.


1 Answers

In the header option of the request, add Content-Type:application/json
header content-type postman json

and in the body, select Raw format and put your json params like {'guid':'61791957-81A3-4264-8F32-49BCFB4544D8'}

body postman json

I've found the solution on http://www.iminfo.in/post/post-json-postman-rest-client-chrome

like image 60
Ema.H Avatar answered Oct 02 '22 18:10

Ema.H