newman -v): 5.2.0We can have a set of commands to execute individual Get, Post, Put, etc. requests too and return the responses.
For example:
newman -get "http://website.com/getpage"newman -post --bodyjson "{"id":"4"}" "http://website.com/postpage"Hey @ShubhamPalriwala
Are you not just describing curl commands here?
curl http://website.com/getpage
Or
curl -X POST -H "Content-Type: application/json" -d "{"id":"4"}" http://website.com/postpage
Not really sure why this would need to be something from Newman.
Curl does not show the response in a pretty format and lacks other detailed stats such as
Having these will increase the precision and add a feature to newman
I'm still not seeing the use case here.
Would you use the different flags of curl to achieve the things you want? Maybe the -v flag for a verbose view of the request/response.
For pretty printing, something like jq would give you that output on the CLI.
One reason I love this feature request is for newman to act as a drop-in replacement of curl.
Curl is great, but not quick and pretty to parse. The same familiar newman CLI design can be used here to show optimum debugging data.
The next amazing thing would be if you're logged into newman and newman auto pushes this data to Postman! With that you now have a new and organised context of request response that has a nice UI to debug along with ability to comment share and collaborate.
I see your point and I can definitely see the linkup with the Postman app a huge benefit to flip between the 2, if needed, but if you're writing out those commands and running them in the CLI - Why not just use the app from the start and benefit from the nice UI? 馃榿
I think having better control over the collection requests, excluding specific folders and possibly adding tags to run certain scenarios from the CLI would be more beneficial than trying to be a replacement for curl.
+1 for this feature
For others landing on this feature request, can you just use the GH thumbs up emoji馃憤馃徎 on the original post, to indicate that you would like to see this in Newman.
Please don't post comments with +1 馃槵
I support this feature request, I generally work with VM that just involves terminal (headless Linux) and Newman is an amazing tool to help me out running collections and testing if the api works fine as its supposed too.
Pretty printing of such custom requests at will and results that provides me similar info as the Postman App (relevant debugging info) would be really beneficial and I believe it would certainly improve the development speed for headless users such as myself 馃槂
@DannyDainton I think this would be a good feature for newman, as it could be useful not only in the CLI but also when using newman as a library. If this feature request is approved, I would love to work on implementing this in newman.
@DannyDainton I can also see a similar issue in this year's GSoC ideas list and I think it wasn't implemented this year in accepted proposals. Although this issue demands using something similar to cURL for individual requests, I think it would totally make sense to combine them both (for collections and individual requests) to test out APIs.
@DannyDainton @shamasis @codenirvana , kindly check this : https://github.com/postmanlabs/newman/pull/2657#issuecomment-797348134
The idea seems pretty neat and feasible. I feel we are just considering the use case of showing the response.
We can try the approach of mapping to Axios in order to build this up.
If an user inputs newman -get <url>
Should be parsed into method: get and url: url
Process the input like:
axios({
method: method,
url: url,
});
And streaming the response to the output.
Would like to know your views @shamasis @codenirvana @coditva ?
@imabp I see where you're coming from, but I feel cUrl is pretty much the standard for sending requests via command line. Their CLI options for sending requests are much more known than axios or any other library.
Hello @coditva sir
Thanks for the inputs. So is it like, are we building this functionality, on top of cURL?
If yes, can you help me out, where exactly this is carried out :)
Edit: Or is it like, we are not going to build this functionality ? 馃槄
So is it like, are we building this functionality, on top of cURL?
No, not really. We'll borrow the options from cUrl but the request sending and response and everything else still happens using postman-runtime and postman-request.
If yes, can you help me out, where exactly this is carried out
Sure, feel free to go through the code of postman-runtime, specifically the lib/requester/requester.js part.
Thank you @coditva sir.
Going through it. :)