Originally Published on my blog
Postman one of the most popular API client tool, for send and view the response
in the development environment. Bu...
For further actions, you may consider blocking this person and/or reporting abuse
When you want change website, you need change all scripts. Why you don't inject main part of URL into all scripts as parameter?
My potential structure of this:
But still is too much repeated parts of this. Maybe one script with one switch?
You can structure the files as you want.
to change the baseurl you can run
or you can use vim-rest-console as some comments mentioned.
The point is to make things easy and avoid havind to remember a bunch of things just to do somethin, this ifs the opposite of automation
I used to do something like this, but not as organize as you describe. Eventually it got a little messy so I ended up creating a cli tool for myself, I call it tinytina. Now I put the api info in a json file and call each endpoint with an "id".
I can even turn that into a curl/httpie command, so I can share it with others.
You could use vim VRC github.com/diepm/vim-rest-console , it allows you to store your requests in a file like
http.rest
It has cool features, I'll give it a try.
Interesting article and sparkle my interest to write a small function for this as you cannot really read a buffer with a command.
Forgot to mention you need to have the latest neovim to enjoy built in lua.
I like this plugin for to do the requests
I like that i can set base url and just set the end points, I'll give it a try.
The main Reason why I use Postman rather then Curl+ vim...
it usually take 8-9 days to design a badass backend, so I worry about response and other thing, rather then using curl.Postman easy
Main
I am a full stack developer, so I need to send the api request's multiple time, just like:
Sigin Signout add to database delete etc etc..
Which requires each time auth, and sending data where post man saves the previous response in terms of Input and Output..
Sending Authorization, formdata etc etc is too easy by using postman
Also the saved requests make it easy to use and test..
Curl is also good, but Postman Makes live too easy..
For me, I replaced it with VS Code and REST client extension
Nice write-up. I like doing things like this in native vim. Why leave when you don't have to. Thanks!
Well, I mean... The point of using Postman is to organize and to avoid dealing with Curl, and to have a pretty UI so you can just click things.
If I have to run away from postman (I use Insomnia nowdays), I would prefer using a testing framework like rspec or pytest so I can keep tjings documented and use a nicer request library.
Curl has always been the default go-to quick-for-testing sny api endpoint, jowever things can get dofficulot if you have to sign your requests like with AWS endpoints, where not even postman would bee a good alternative.
I guess my two cents here is: curl has always been there for you and always have been, but using it as a postman alternative has the potential to consume your time
Great article Mahmoud. I also enjoyed using httpie though i still stick to Postman for the day to day.