HN2new | past | comments | ask | show | jobs | submitlogin
Show HN: Prestige, a text based HTTP client, for working with HTTP APIs (prestigemad.com)
117 points by sharat87 on June 6, 2021 | hide | past | favorite | 38 comments


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.

Hope you like it.


What do you use it for?

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.


Hey, thanks for asking.

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.


This is a handy tool to convert curl to the python requests equivalent automatically.

https://curl.trillworks.com

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.


Hey that's a nice tool! I didn't know that existed and now I'm wondering why I didn't think to Google and find out. Thanks for sharing!


This is clearly a labour of love. Well done, congrats on releasing :)


Thank you so much :)


This is a really great idea. Well done!


Thank you very much. :)


I use something very similar for a very long time already in vcode: https://marketplace.visualstudio.com/items?itemName=humao.re...


Yeah came here to say the same thing, the VS Code HTTP Client extension is fantastic..

Lets you save your requests alongside your code, you can even define variables and do multi-step requests etc..


Hey, yes, this was very much an inspiration when I started off (as can be seen by the same `###` separator lines. Thanks for sharing!


A very similar project for Emacs users: https://github.com/pashky/restclient.el


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.

[1] https://github.com/federicotdn/verb


Thanks for sharing a link to the project! :) The original submission link reminded me a lot of the general restclient/verb syntax.


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 :)


Very nice!

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 :) ?

Thanks for your work.

0: https://hoppscotch.io/


Hey, thank you!

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.


Hey, thank you! Integration with GitHub is something I intend to add. Additionally, I plan to add working with files from Dropbox as well.

I haven’t thought about Gist specifically though. That’s a good idea. Let me explore what can be done with it. Thanks again!


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.)

Also reminds me of JetBrains' client: https://www.jetbrains.com/help/phpstorm/http-client-in-produ...


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.


Hey, thanks so much!

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 ;)


Sounds amazing! Best of luck with everything, I'll be watching the repo closely.


Thank you


I love this! Excellent combination of GUI and textarea. Does it keep working if you cmd+save it locally?


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.

Will check this out. Thanks!


Hey! Thank you very much. Prestige is open source as well. You can checkout the code at https://github.com/sharat87/prestige. :)


Nice tool it will be more nicer if it have graphql.


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:

    POST https://api.github.com/graphql
    Content-Type: application/json
    Authorization: Bearer github-personal-api-token

    ={query: `
    {
      repository(owner: "appsmithorg", name: "appsmith") {
        releases(orderBy: {field: CREATED_AT, direction: DESC}, first: 20) {
          nodes {
            tagName
            name
            url
            descriptionHtml: descriptionHTML
            createdAt
            publishedAt
            isDraft
            isPrerelease
          }
          totalCount
        }
      }
    }
    `}
Know more about this way of running queries at http://localhost:3045/docs/guides/templating/.


nice work mate!


Heyy thanks dude!!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: