DEV Community

Discussion on: Bye bye Postman ! Let's share your REST API calls in team, easily !

Collapse
 
char0n profile image
Vladimír Gorej • Edited

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

Collapse
 
aurelio profile image
Aurelio

Fantastic comment, very insightful

Collapse
 
monisnapjonathan profile image
Jonathan BROSSARD

Thanks a lot @char0n for this whole comment, terribly interesting !

Collapse
 
char0n profile image
Vladimír Gorej

As I found out today JetBrains has actual plans to implement a runner for the spec: youtrack.jetbrains.com/issue/WI-42002