This is an HTTP client devtool, similar to Postman or Insomnia, but completely text-based. I've been developing it, using it for over a year now, as a weekend project. It's open source, hosted at GitHub, https://github.com/sharat87/prestige.
The syntax looks simple, and the results are clearly formatted - just trying to understand what kind of workflow makes this favorable to something like curl or python-requests.
I use this to play with and test APIs I'm developing, or APIs that I want to develop against. For example. GitHub has a public API that can be used to access repositories and details about the repositories. I use Prestige to try out an example request, and tune the request to get the exact response that I want and _then_ translate it to use python-requests (if I want to use it in Python) or something else.
Since chromium-based browsers will generate curl requests from the network tab of devtools, you can use that along with the above to quickly generate code to replay requests with python.
Rest client is great, but a lot of the cool (emacs) kids have moved over to verb-mode [1]. To be fair, you can probably achieve something similar with org-mode and rest-client, but the verb-mode integration is very nice.
Ah! Yes, thanks for sharing. I should've guessed this existed for Emacs as well. I played around with implementing a similar concept like this in Vim, in 2019 (link: https://github.com/sharat87/roast.vim). Unfortunately, while I love Vim as an editor, I couldn't do a lot of features that I wanted. So I moved to the browser and built Prestige :)
One feature of postman/hoppscotch[0] is that it makes it easy to do oauth2 calls PRIOR to hitting the actual desired endpoint. If you're itching to add new features may I suggest that might be a good one :) ?
Not kidding, I was thinking about how I could make talking to APIs behind an OAuth wall easier in Prestige, just this morning (it's evening for me now). I didn't know Postman and Hoppscotch did that. I'll ideate for some time first and then see how they solved it.
But yes, I do want to add something like this in the future. Thanks for the pointer!
That's neat! I like the workbook style for stashing snippets and re-running them, or even for documenting something and sharing it with someone else.
Is there a way to persist my session? In a tool I wrote a while ago I added a really lightweight gist integration - you could connect to github, then hit save in the app and it'd do a client-side save to GitHub and update your URL to match the gist ID.
Then, on returning to the page, if there was a gist ID in the URL, it'd fetch it from github.
EDIT: Ah, just found the browser local storage option.
This is great. It's an alternative for those who don't want a full IDE or are just getting started with API work. (I hope there's a fully offline version.)
Hey, thanks for the kind words. Unfortunately, there isn't yet an offline version of this, although I've wanted to do one for the longest of times. But thanks for mentioning, it gives me a pulse of what folks are looking for.
I was actually using the JetBrains version of this idea until a few years ago. The thing that put me off there was that the results weren't visible instantly. I had to click and open another file to see the results. Having a split pane open with the results was something I sorely missed.
This is really cool! Would be interested to see if the JavaScript blocks could be used to essentially run integration tests using something like this, so you could assert that the response has certain properties. Being able to define an entire test suite for a service in a format like this would be really useful.
Yes, all of those are indeed things I want to add. I plan is to have a headless runner, like a `prestige-run` command that will take a Prestige sheet file and run the JS blocks, HTTP requests in it and report the result of assertions. It's some distance away, yes, but hopefully, I'll get there :)
JS blocks that take the response of a request to assert values is currently not there. This is something I myself wanted on so many occasions, but haven't got around to doing it. Thanks for chiming in, I'll take your word as a vote of interest on this feature ;)
Hey! Thank you very much. I haven't actually thought about it. My gut feeling says it _won't_, but I'm not able to point out a reason. But that's a good idea, I do want to have a local version of this someday, perhaps it could be that simple?
From poking around it doesn't seem like you're using a framework like React or Vue - if this is straight HTML/CSS/JS it should be possible to just save the page and all its dependencies and it would work flawlessly (minus the OAuth integration which would need a backend to host a redirect URI).
Oh I'm not that super with JS to do something like this without a framework. It's running on MithrilJS (https://mithril.js.org/), which is, IMO, the most _practical_ framework for single page applications.
But saving all the HTML/CSS/JS and running it locally should work fine nonetheless though. What I'm a bit doubtful of is, if it would be able to do the XHR calls on file:// protocol. I'm not sure about how the browsers of today behave there.
Also, OAuth integration? Prestige has OAuth? (surprised-pikachu-face.gif)
> If it would be able to do the XHR calls on file:// protocol
As long as the endpoint being fetched returns the correct CORS headers, fetch should work on file:// pages. You just can't fetch other file:// URIs with it.
> Prestige has OAuth? (surprised-pikachu-face.gif)
Not yet, but:
> Integrations with more storage providers like GitHub and Dropbox coming soon.
I think you're planning on adding it sooner or later :p
I see. I didn't know about being able to fetch from file:// pages. Thanks for the heads-up.
Yep, I do want to integrate with those services and that will involve OAuth. You just zoomed into the future and gave me kind of a wake-up call treating it as if it's already there! :)
Very nice. I’ve been using insomnia && postman, but I always thought a text based tool would go with the other tools I’m using (sublime and terminal) for developing APIs.
Hey, glad you asked. GraphQL queries are actually just POST requests to a GraphQL endpoint. Although the experience is not something I'm proud of, it's indeed possible to hit GraphQL queries in the following manner:
Hope you like it.