Why Postman send empty data in POST method - api

When I develop POST api, I used POSTMAN I create following request
But it seems send empty request to servers.
When I check server, the following error was displayed
Error: data and salt arguments required
It means empty body was send via POSTMAN
On the other hand ,When I tried
curl --data "loginId=hikaru&password=test" http://localhost:3000/user
following error was occured but some data was send and reached
ER_NO_DEFAULT_FOR_FIELD: Field 'firstName' doesn't have a default value
So what is the difference between POSTMAN and command ?
What is the wrong point of postman
I'd like to fix it.
If someone has opinion,please let me know.
Thanks

Related

I need to assert the response I sent via pm.sendRequest()

I have created a POST request to generate a token for myself. Next, I wrote the code for assertion using pm.test() and its working. Following that, I sent another request via pm.sendRequest(). As a result of this request, I am receiving a response but not able to assert it.
I should be able to assert a response if I am receiving one
. Any and all help is appreciated!

CDiscount: Problem sending a JSON Get request through Postman

I've been trying to send a GET request to CDiscount's GetProducts API by using the Json format provided by the documentation and have been met with an Error: read ECONNRESET.
I use the Raw (set to JSON) window in Body to send this request.
Any ideas on how to solve this?
GET request doesn't send Body content. Only for POST and PUT send body.

Postwoman API Tester response is always empty

Postwoman (now Hoppscotch) is an API request builder (like Postman) that I love the idea of because it's open source, but I'm not getting any response showing up in the Response field. It's a private API I'm hitting so I'd rather not show my request but it's a POST and my API is sending back the correct response (that works fine in Postman). I'm seeing the following error in the browser console:
TypeError: text.match is not a function
Is anybody else having this problem?
Adding browser extension:
https://addons.mozilla.org/en-US/firefox/addon/hoppscotch/
done the trick for me

Sending GET request parameters in body

I have an API which accepts many parameters.
Passing the values of the parameters will exceed the length of the URL Header.
I am using Postman client to pass the parameters in the body but this is not working any ideas on how to make this work.
The API accepts many parameters because the backend is legacy and is exposed as an API by a service bus.
Older versions of Postman didn't allow you to send body data with get request.
Yet, if your server receives data as URL parameters you won't be able just to change the way of sending them and include them to the body (server won't accept them).
So if the length of parameters is indeed so big and the server indeed can receive the same data from body instead of from parameters then the Postman is just not the tool that you can use (maybe cURL is for you).
If your server allows to send data only as URL parameters and they are so long (more then 2000 chars What is the maximum length of a URL in different browsers?) then I think you have no chances to test this API.
UPDATE: new Version 7.20.1 now allows to send Body with GET request
Workaround:
Change the request type to POST.
Set the value of your body
Change request type to GET
Send request and the body is included
Postman is already added this feature of sending body in get
request.
But i still i recommended to go for post request (if body is present) since many projects like angular http client does't have updated protocols yet.
Latest Postman supports body object for Get request
just choose json format as shown in pic above
If you want to make a GET request in Postman then you can use Params or Body to pass parameters, but not both. Either Params only or Body only. If you specify both Params and Body, Postman will select and send only Params (in GET request of course). So if you want it to send Body, clear Params.

Rest Post Multipart form data - spot the difference

I have the following rest request that works:
And the following one that doesn't work:
And here is the the response from the bad message:
The bad response was run through PowerShell but it shouldn't matter as I can see everything that is getting sent in Fiddler.
Can anyone spot what I have done wrong in the bad request?