Comment by vrnvu

Comment by vrnvu 4 days ago

4 replies

Made me think. Every time I see a “Postman collection” or similar artifacts, my heart skips a bit. Use curl. Run it interactively in the terminal. When it works, move it into a shell script where you can simply check the status code. Voilà, magic! you’ve got yourself a simple but valuable integration test.

Instead of juggling dashboards and collections of requests, or relying on your shell history as Matklad mentions, you have it in a file that you can commit and plug into CI. Win-win.

At some point, that testing shell script can be integrated into your codebase using your working language and build tooling.

easton 4 days ago

I run into that too. Someone sends me a Postman, and I sit there fiddling with the UI five or ten times instead of just putting it into a loop in a real program. then realize how much time i spent fiddling and pull it into a program, then spend some copying the auth or whatever over, then realize i should've been doing real work.

People like Postman because it's easy to share credentials and config, and easy(ish) to give to less technical people, but the cliff for pulling that stuff into code is often annoying.

"Postman but actually it's a jupyter-style notebook with your credentials" would be cool, although I don't know exactly what that would look like.

WorldMaker 4 days ago

I think the biggest hurdle with curl is its syntax. The original HTTPie CLI [1] has a really great syntax that closer resembles something like making a "Postman collection". About the only thing I'm missing these days in httpie that my Postman (and Insomnia) preferring colleagues have is a good plugin for OAuth2/OIDC auth flows.

[1] https://httpie.io/cli

tracker1 3 days ago

I can just as easily do this in a TS file with Deno and fetch() ... not only that, but it's 1:1 to what I can now put into a browser and work with.

Beyond this, I can (re)use client libraries to work with examples, create one-off utility scripts, etc.

  • vrnvu 3 days ago

    I really liked the example in OP. I will give Deno and Dax a shot.