As developer, we are using tools to make REST API calls (Postman, Insomnia, PostWoman...), and these tools are very usefull.
The limits
...
For further actions, you may consider blocking this person and/or reporting abuse
Thank you for the article and opening this topic. I been using this feature in JetBrains products for some time. It's a great tool for helping you in local development. Also having an ability to create .http files and store them as part of your CVS and share it with your team is a great benefit. There is a great hidden potential in .http files.
But there are some problems concerning cross tooling compatibility and integration. The concept actually has a name: HTTP Request in Editor Specification. This name is shared by both JetBrains and VS code extensions (partially in form of HTTP Request in Editor) respectively. JetBrains went a step further and created a actual RFC specification strictly based on RFC 7230. VS code extension claims to be based on RFC 2616 which has been obsoleted by RFC 7230 some time ago. So you can have possible problems when created files in VS code and running in them in JetBrains. Both extensions claim to support .http/.rest file extension, but IMHO .http file extension should be used exclusively because .rest can be confused with Docutils reStructuredText Document.
There is also an important question of validation and testing. JetBrains extension supports Response Handlers which can intercept the HTTP Responses, validate and assert them. They can be written in ES5 (JavaScript). These Response Handler files can live along with .http files and make sure when somebody is using those file to make HTTP requests he gets expected response. The only problem is that you have to run .http files (with Response Handlers) in JetBrains IDE. So far I haven't found a library that could run the .http files with Response Handlers via CLI. If there was such a library it would allow us to run API tests based on .http files on CI (good idea for opensource project:) and verify .http files against my API. It would also allow running .http files for people not using JetBrains or VS code IDEs.
So I think there is a great potential in this, and the community can fill some gaps that will allow us to utilize HTTP Request in Editor Specification into it's full potential.
Can HTTP Request in Editor Specification replace Postman? I don't think so, at this point in time. But in future, with more tools, integrations and libraries? I'd say: yes, very possibly.
HTTP Request in Editor specification (by Jetbrains): github.com/JetBrains/http-request-...
RFC 7230 - tools.ietf.org/html/rfc7230#sectio...
RFC 2616 - w3.org/Protocols/rfc2616/rfc2616-s...
Implementation of the spec in mainstream languages: github.com/JetBrains/http-request-...
JetBrains HTTP Client documentation: jetbrains.com/help/idea/http-clien...
Rest CLIENT VS extension: marketplace.visualstudio.com/items...
CLI runner for HTTP Request in Editor jetbrains issue: youtrack.jetbrains.com/issue/WI-42002
Thanks a lot @char0n for this whole comment, terribly interesting !
As I found out today JetBrains has actual plans to implement a runner for the spec: youtrack.jetbrains.com/issue/WI-42002
Fantastic comment, very insightful
Many thanks @ankush981, indeed, probably one of the best reason : "why open another RAM-hungry app" !
For Peter Edwards...
Some unfortunate souls are forced to work with underwhelming equipment that benefit from not having yet another tool running. Regardless of capacity... My personal stuff runs circles around the dev env I have to use for work. Everything I can do with something like VS code I do to make that work system at least usable....
Even if i’m not forced (i could easily afford expanding my RAM), some simply doesn’t want to. I refuse to buy RAM just to run another RAM-hogging app (most probably a “Desktop App” built on Electron) and will use a less RAM-demanding, actually native program. If there is none, i need to be really interested in the platform to put some money in using it (not the case most of the time).
So please, optimize for RAM. Even with today’s tech like SSD drives and such it worth it.
Ram-hungry? Equipment is cheap compared to salaries these days running out of ram should just not happen even with swapfile disabled
Maybe some people play games while building the app and testing lol
It's more like a mind-set, I don't want to have "one more" app launched. We all already have IDE, Chrome, Sequel, Slack, Trello, Terminal ...
Yeah, lagging will mess my mood. if it's not 60fps then I'll not code hahaha just kidding 😂
Meh, Postman is still better than this in my humble opinion. They're making you pay for a good reason. I'm getting old, I want a nice an intuitive interface. I pay to save my time and Postman is really helping with this.
EDIT: I just tested it, still a big MEH. Not sure how big your projects are but I feel this is not suitable for the size of my projects.
We have a lot of REST APIs to test, as well as a lot of variables that need changing on the fly quickly by testers to test certain scenarios. For us, Postman works better. This plugin is ok but we have powershell scripts that can do the same stuff and its not as intuitive.
I get the idea behind this in that it just "fits" into version control etc and in theory its easier to have VSCode installed, but I think there is space for both of these tools. This extension fits nicely for quick dev test stuff, but I think I still prefer Postman for more complex scenarios, plus it has a host of other features.
Hmm, if it fit you and your team organisation, it can be a solution, for sure :) We're trying here, to avoid to get thousands of tools and be sure to be up to date with "just the repo".
You must be doing a lot. I use a lot of tools too (I work fully digitally), but I close the ones I don't use right away.
Some ones are always opened you know (IDE, Slack, Database connection, Terminal, Trello, Chrome etc..) hard to be able to close each tool one you're done with.
That's really not a lot. And that's about all I need as a fullstack developer. The terminal is part of VSCode and I use pen and paper for my tasks (with ClickUp for project management). I don't use any messaging app WHILE coding, no distractions.
Even tho I dabble with many parts of the systems I maintain and build, I don't have more than 6-8 apps open at the same time. And this is not even half of the apps I can handle open at the same time.
I feel like we're bringing a problem that does not exist just to justify the use of this tool... and I feel like a hater, so I'll stop at this. ;) I hope it's useful to anyone else. I'll try to get more invested into testing it out in the future.
Is there a version of this for Jetbrains??
Hi @alejandrorios ! Did you already check jetbrains.com/help/idea/http-clien... ?
😮 I didn't know it, thanks
💪
It's nice but one thing to consider. You can share the whole workspace of postman either with a single person or with a team, your choice. I think that reduces the pain of editing the source code or it's syntax maybe.😁
Hi @mohdraqif1 . Yes, you're right, but by putting it into your repo, you can be sure that it's always up to date :) I think that we should never be afraid of updating code/repo.
If we're afraid, it may mean that we are not confident :)
Another addition is our project: Postwoman.io - Online API request builder.
GitHub: github.com/liyasthomas/postwoman
Hi @liyasthomas , It let you save everything in a file that you can share with your team and version into the project repo ?
ps : but believe me, it's on my favorite (from the time where favicon was an Alien head ;) ) and I often use it !
Versioning and saving to GitHub repo will be the perfect option :) can not wait to see it !
On it. 🌈🌈
Maybe let the Alien face as favicon come back, I have so many favorites but this one, I saw it first each time ^
Will consider that ❤️
😍
"Versioning and saving to GitHub repo - Work in progress"
Didn't see an issue to follow for this. Is it complete now? Thanks
Holy balls this is awesome! I'm working solo at the moment so keeping Postman up to date has been at the absolute bottom of my priority list... My workspace already has 5 necessary windows up(VS, Server console, Code and Chrome) and having to switch between them is already a nightmare without introducing Postman to the mix.
Being able to test the API without leaving Code would be a godsend! Damn am I happy your article showed up in my feed, thanks a googolplex! I didn't even think about using something other than Postman.
Hi @thebojan , that's a limit we had with Postman and its workspace... Very happy that we can help you :)
Ford development that is great, but as a generic tool, Postman can export/import curl calls that can be copy/paste to and from terminals
Also, can the env vars be used to parameterize the actual content of the requests? How can certificates be configured?
Yes it's true that the ability from Postman to generate the command for cURL, Node, PHP, Ruby, Python can be very usefull !
Yes, Auth via SSL Client Certificates is support :)
I am getting below error while posting the call
write EPROTO 1215459160:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../third_party/boringssl/src/ssl/tls_record.cc:242:
Check if u not trying to call yr API using
https
when it supportshttp
thank you
Are you using https instead of http? Maybe this is the problem
Try to use http after your request. e.g GET localhost:3000/articles HTTP/2.0
I have the same error until i use this.
thank u
Looks like it come from API you're trying to call no ?
REST Client is such a great tool. We using extensively for the purpose of testing, and sharing examples in our project repos.
The ability to use JSONPath to follow links or grab values from your API response to form the next request is invaluable. Not to mention really great for demonstrating how REST APIs are meant to look and work!
If you've not tried it, give it a go. You need to name your request with:
# @name MyAwesomeRequest
But then once you've invoked it you can access a variable of the same name so
{{ MyAwesomeRequest... }}
the request and response plus the headers and body for both.It's only more recently I stumbled across the environments feature, but that's made a huge difference in cutting down the noise of declaring loads of variables that change per environment.
Hi @devjonny !
Totally agree, grabing values from previous API responses is amazing and let you easily test calls sequences.
Many thanks for this sharing, hope it could help readers to deep dive on this such great extension !
Glad to know I'm not the only one who refuses to use postman for simple tasks. I actually build myself command-line utility for the most basic use case, that is making a request based of a collection in a json file.
Hi @vonheikemen , thanks a lot for the sharing !
I think the good idea is to have the tests in your repository.
Is there a way to place insomnia/postman configurations in our own repos?
It's not a problem to open another program to me.
Hi @cirelli94 , yes you can. You could export your Postman calls into a json config file and store it into your repository. But, each time you make an update into Postman, unfortunately, you have to re-export file. You can't just open your versioned json config file into Postman, make your updates, and just make Ctrl+S, it doesn't work, because Postman save it into the Postman application directory.
Mm maybe insomnia?
The problem is that in an office you can't impose a IDE, my coworker would kill me 😆
I understand ^
Don't know about Insomia, as VS Code fit our needs based on our stack, it's for us the best IDE in term of IDE and save a lot of time (versionning, unit tests, integration tests, lint etc..) :)
Why can you impose Insomnia or Postman, but not VSCode?
VS Code is pretty perfect for our stack, so actually, if I would change my IDE, I still did not find better. About Postam, Insomnia, I do not impose it to my team, but if I want, in repositories, everyone can share API Calls, REST Client is perfect and free.
Two things that made me leave Postman:
1: i signed in to see what the value-add was, only to discover it ingested all of my collections into an online profile that vanished from local storage when I signed out. I was not expecting that, nor was I thrilled.
2: the (then) attitude that postman developers knew better than its users, and added superfluous request headers with no way to remove them.
it sounds like this would never cause #1 to happen. but, what about #2?
This is interesting, but I would like to see examples of how to use consume an URL (either with Get or Post), grab its JSON response to extract a property like a Bearer token and reuse it in subsequent calls. You can also grab any other piece of information from JSON that you might have such as a user ID, username, whatever and reuse them in further calls. Postman can do that. Would REST Client be able to do it?
Biggest pro in my eyes is natural source control integration! Postman has some truly great potential; but what it has lacked for me is file-level source control. Postman offers Git integration; but it's not within your existing repos - therefore you can't easily pair source code versions with sample HTTP request versions.
Woah, that's super cool. Have found in the past that saved Postman collections are kinda awkward to deal with in a team environment, but with this one could create a saved collection of requests, and then commit that to source control to share. If any of the requests change you just update that file.
Seems to me too it wouldn't be super hard to generate a Postman collection from a file that REST Client uses, so for those teammates that don't use VS Code for whatever reason, you could still have them generate an equivalent collection to use in Postman.
Cool, I didn't know that. One problem I see: we were able to teach some of our non-programmers colleagues to use Postman to some extent. But I don't see them learning how to use VSCode for that ;)
Yes you're right. But pretty okay here because the purpose is to share API calls between developers team :)
It's great to call REST requests from VSCode. I've just tried and it worked well with a limitation. In the response panel it only shows a single response(response to the last request) although there are multiple requests in the
.http
file.And for those using vim, you can use something like this :
github.com/diepm/vim-rest-console :)
Thanks a lot @hyde_stevenson :)
You're welcome :)
Actually unused RAM is wasted RAM. This stil doesn’t not explain slowness of Postman.
Usually people treat RAM that is being used by OS for permanent storage data cache as free. That is just soo wrong.
We could easily use it if this add-on would be compatible with restclient.el (an Emacs package with a similar purpose), as both editors are widely used at our company. But in this way, it’s just another way to do the same thing…
We do not want create a standard... just show an easy way to share infos between colleagues ;)
sounds good, thanks!
Thanks @beelzenef !
Fantastic, most of the time I reach for
curl
(rather than Postman etc) to do this kind of thing, but this looks great, and potentially easier thancurl
I usually like having to use less tools, but I disagree for one reason: text editors are a very personal choice, plus this choice changes from time to time (I've been through many different text editors). So this will lock you and the entire team in one text editor.
Besides, you can also export your postman collection into one json file and put that in version control, no need for the payed plan. Other tools (insomnia) are able to import that => maybe it's compatible with VS code? That'll be nice.
I would not (easily) join a team, that forces me to use one particular text editor ;)
If you really want to cut tools, how about curl?
You can also auto-generate a OAS3 compliant API documentation, which you can use to, well, have a documentation, and also use it with curl. Or render it in the browser and build a little UI that allows you to fire requests from your browser. Serve that documentation file from your server, and also the frontenders can render the UI to make requests without having to run the API on their local machine.
I understand your point.
Export Postman collection exposes you as the fact that you always need to do that (Postman don't auto save into your repo) and it's pretty boring.
The main point here is to be able to maintain it into a repo, without need another tool. It could be a shell script which make cURLs... but can be a pain in the @$$ to get all available features you'll find with REST Client, into a simple shell script.
I fully understand your point about the IDE. Really. In my case, I use during many years Emacs, then Sublime Text, and did not want to get a big IDE. But I opened VS Code and many others, and check the time saved ... based on our tech stack, currently VS Code seems to be the best choice.
I we would to have a final word, we could say that the better world is a .yml file to get a swagger
One think that I really like about postman/similar app is the history. Trying a different authentication/query params/payload will be hard if we have to constantly undo and redo the changes.
Yeah, agree ! History is a great feature !
Nah! I'll go with Postman. It has a great features for sending and receiving a response. But, thanks for sharing, maybe I will use that in some situation.
Great article, I'm only confused about how to set environments. I can't find any guide to set environments (not even in the extension documentation). Can someone help me please???
Hi @crisdan1905 ,
Don't you find more info event under "Environments and custom/system variables support" section in marketplace.visualstudio.com/items... page ?
Jon
Hi Jon, it's just that I hadn't worked with environment variables before on VSCode, so I had no idea how to create an environment file and VSCode documentation about it was a bit confusing to me. Finally, I figured it out in another guide. It may be useful to explain how to create the file in your documentation :)
Great tool by the way, I just loved it and will keep using it
I'm reminded of this feature from IntelliJ IDEA.
jetbrains.com/help/idea/http-clien...
curl. That's all.
😄
Http and rest files are also supported in jetbrains IDEs. jetbrains.com/help/rider/Http_clie...
Great ! It could be usefull for @alejandrorios I guess
Insomnia.
This is so sweet, less switching workspaces, more coding
Love REST client!
I still love postman. It have some other features too 😄
Been using it for a while now and I must say it very convenient having your tests right there.
It’s also simple and quick to use.
🙂
imgs.xkcd.com/comics/standards.png
Why file? Why don't use already existing standards ? For example: swagger.io/docs/specification/about/
I fully understand your points, but REST Client have some interesting features like requests sequences, variables handling and it's easier to edit and click to play request on the same file that update your yaml and then execute the swagger.
REST Client, in my point of view, is NOT an OTHER NEW standard, just a cool tool to ease team work.
It's not a way to replace a swagger, and it wasn't my point :)
Are you planning to have functionality to have collections? Basically saying, saved request interfaces and ability to import from swagger/openapi/soap/etc ?
I have recently discovered this extension and have fallen in love with it.
I now use it for all of my development works. It is such a great extension.
this will be very helpful if this can replace postman i.e all postman can do this extension can do too.
do this extension also support multipart requests?
Yes. marketplace.visualstudio.com/items...
Where do you put the config with the "environment variables"?
One link is better than 1 000 words :) marketplace.visualstudio.com/items...
Niiice!
Thanks @faridos :)
Thanks for sharing.
We have been using this extension in our project for the last 1year and a half and it works really well 👍🏽
It's also a very light way to document your endpoints.
Thanks for sharing 💯
Since Postman free plan will archive your collection (community.postman.com/t/how-do-i-g...), this is great way to share the API with the team!! Nice!!
Great extension will give it a try.
Here is another alternative that I am using httpie.org/
Here is a comparison with postman konghq.com/blog/postman-httpie-tes...
Sound great !!! Thanks @giorgosk
For linux users we don't need any rest client because cURL is more easy
There's curl for windows too, but rest client is quite different thing in a team development perspective
Meh, it's just different. Postman is good and it's simply doing its job. I can't see any reason I should migrate.
Very important to be able to integrate API calls like these into your test pipelines -- so does it work-with/replace Newman?
Yeah, but this is vs code dependent. Deal breaker.
Great extension!! what about streaming data. Does it support websocket?
I've been using the REST Client VSCode extension for over a year now, but this is the first time I'm seeing such an in-depth look into the various config options. Thanks.
Wow, will try this out
yes but you do not have the ability to have it into your repo without, each time, export it, and 20 times in a day... it's painful