xdochu
(Doc Hudson)
1
So this is the example,
curl --request POST
–url ‘https://test/Test1/Test2/v1/’
–header ‘authorization: Basic {{AUTH_HASH}}’
–header ‘content-type: application/json; charset=utf-8’
–data ‘{“saleid”:123456,“price”:500}’
I know how to put the Request URL and the 2 Headers, and I am actually new to Postman. So how do you actually use this line below?
–data ‘{“saleid”:123456,“price”:500}’
Chris
(Chris)
2
I’m no curl expert, but it looks like the -data
flag is the Body
of the request being POST
ed .
You have a few options for populating your POST request body – form-data
, x-www-form-urlencoded
, raw
, and binary
.
I mocked up two POST requests using form-data
and raw
(JSON), and you can use the Run in Postman button below to download it .
Our documentation on Requests has a nice overview of the different ways to populate the request body here – https://www.getpostman.com/docs/postman/sending_api_requests/requests
1 Like