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.
Related
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!
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
Thank you for the nice work you put into this amazing library.
I have an issue with my request adapter but only with the MultipartFormData.
I want to be able to update the body of the request but when the request gets in the adapter, I'm getting a nil httpBody. I only get this behaviour on Multipart, not on classic POST requests.
I'm trying to sign the request with an oauth2 token (async), but the particularity of this API is that the token is sent in the body and not in the headers.
There's a body as the metrics in the response say (Request Body Transfer Bytes) 231306
I'm using Alamofire 5.0.0
This is most likely due to multipart forms using UploadRequests (and therefore URLSessionUploadTasks) which do not include the body data as part of the URLRequest for performance reasons. If you update your question with what you're trying to do to the body, perhaps I can provide an alternate solution. If nothing else, you could manually create multipart uploads by using MultipartFormData.encode() directly and adding the Data to a URLRequest, but that's not recommended for large uploads.
How can you access the response body of System.Net.Http.HttpConnectionResponseContent?
I'm trying to use the SendGrid API to send an email and it returns an 'HttpConnectionResponseContent' object. How can I acutally get to the response body (string) or JSON? I can't even see how I get hold of the underlying stream.
You can through this to get the content body:
response.Body.ReadAsStringAsync()
You can refer to this.
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.