[HN Gopher] Show HN: Prestige, a text based HTTP client, for wor...
       ___________________________________________________________________
        
       Show HN: Prestige, a text based HTTP client, for working with HTTP
       APIs
        
       Author : sharat87
       Score  : 89 points
       Date   : 2021-06-06 11:42 UTC (11 hours ago)
        
 (HTM) web link (prestigemad.com)
 (TXT) w3m dump (prestigemad.com)
        
       | sharat87 wrote:
       | 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.
        
         | tony-allan wrote:
         | This is a really great idea. Well done!
        
           | sharat87 wrote:
           | Thank you very much. :)
        
         | samvher wrote:
         | 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.
        
           | sharat87 wrote:
           | 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.
        
             | epr wrote:
             | 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.
        
               | sharat87 wrote:
               | 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!
        
         | scrollaway wrote:
         | This is clearly a labour of love. Well done, congrats on
         | releasing :)
        
           | sharat87 wrote:
           | Thank you so much :)
        
       | nexuist wrote:
       | I love this! Excellent combination of GUI and textarea. Does it
       | keep working if you cmd+save it locally?
        
         | sharat87 wrote:
         | 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?
        
           | nexuist wrote:
           | 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).
        
             | sharat87 wrote:
             | 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)
        
               | nexuist wrote:
               | > 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
        
               | sharat87 wrote:
               | 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! :)
        
       | paco3346 wrote:
       | 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...
        
         | sharat87 wrote:
         | 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.
        
       | anotherhue wrote:
       | 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/
        
         | sharat87 wrote:
         | 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!
        
       | alanpearce wrote:
       | A very similar project for Emacs users:
       | https://github.com/pashky/restclient.el
        
         | marco_craveiro wrote:
         | 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
        
           | federicotdn wrote:
           | Thanks for sharing a link to the project! :) The original
           | submission link reminded me a lot of the general
           | restclient/verb syntax.
        
         | sharat87 wrote:
         | 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 :)
        
       | opheliate wrote:
       | 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.
        
         | sharat87 wrote:
         | 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 ;)
        
           | opheliate wrote:
           | Sounds amazing! Best of luck with everything, I'll be
           | watching the repo closely.
        
             | sharat87 wrote:
             | Thank you
        
       | Gys wrote:
       | I use something very similar for a very long time already in
       | vcode:
       | https://marketplace.visualstudio.com/items?itemName=humao.re...
        
         | sharat87 wrote:
         | Hey, yes, this was very much an inspiration when I started off
         | (as can be seen by the same `###` separator lines. Thanks for
         | sharing!
        
         | sbarre wrote:
         | 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..
        
       | cldellow wrote:
       | 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.
        
         | sharat87 wrote:
         | 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!
        
       | tanaypingalkar wrote:
       | Nice tool it will be more nicer if it have graphql.
        
       | RileyJames wrote:
       | 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!
        
       ___________________________________________________________________
       (page generated 2021-06-06 23:02 UTC)