3 ms·
The REST Client VSCode extension[0] let's you send HTTP request from any file open in the editor. I use it to call the Cloudflare API to purge the cache of my s
by XCSme 7y ago
The REST Client VSCode extension[0] let's you send HTTP request from any file open in the editor. I use it to call the Cloudflare API to purge the cache of my site after I make changes. It's also really useful to test new APIs or quickly create a bunch of file/requests for the current project.
I use PHP on my landing page[1] so I can make changes and publish them immediately without any build step. This way, whenever I see something wrong with my site or have a new idea, I just open the editor, change the file, save and push all changed files through FTP to the server using the VSCode SFTP extension[2]. This means that I can instantly publish changes from VSCode without running any command, just by using shortcuts. This way I can make the changes immediately instead of having to create reminder tickets.
Automate the tasks you do often. For example, I had to download invoices from Envato every quarter, which was annoying because they don't have a button to export the PDFs of all invoices. I created a puppeteer script (headless Chrome) to download the CSV with the list of invoices, go to the URL of each of those invoices, print the file as PDF and save it into the correct folder. The automation part can also be just creating a faster build process, unit tests or even subscribing to notifications/alerts for a social site for the content you are interested instead of checking everytime if there's anything you might like.
[0]https://marketplace.visualstudio.com/items?itemName=humao.rest-client https://marketplace.visualstudio.com/items?itemName=humao.re...
[1]https://usertrack.net/ https://usertrack.net/
[2]https://marketplace.visualstudio.com/items?itemName=liximomo.sftp https://marketplace.visualstudio.com/items?itemName=liximomo...
- CraftThatBlock 7y agoSame for IntelliJ-based editor! It's incredibly useful to store the .http files inside git repos, an have it tracked alongside with code. It's similar to Postman or Insomnia, but tracked (and synced), and built-in
- kanyethegreat 7y agoThis is awesome. I usually just have a scratch file that uses an http library (eg. requests for python) and log the response. Do you prefer this over something like postman?
- XCSme 7y agoYes, I only use this now. I used postman for a while, but I remember last time I tried it, it was way too complex, had to create projects or accounts (or something like that) to make a simple request. I now only use this VSCode extension, I have some .http files saved in my project with requests I do often. If I am trying an API online, I just copy-paste their cURL examples and run them, it's useful because on Windows there is no cURL cmd preinstalled. It's also nice that you get code highlighting by default in VSCode for the .http files.
- XCSme 7y agoAnother big advantage is that you don't have to open a new console or application. You just do CTRL+N to open a new file and ALT+CTR+R to send the request. So you can do CTRL+N, write google.com, ALT+CTR+R and you can see the source-code of google.com in a VSCode file. Having the request in a file means you can easily change it, save it or version it.
- gavinray 7y agoI use this too, it's great! My usecase is that I often have queries for debugging purposes for API's that I need to send, so in my repos I keep a requests.http file for quick-access. I also put them in repos for projects I publish (like boilerplate/demo API's) along with a screenshot and a note + link to the extension in the README because you have a working spec for API requests, and so do if/when I ever revisit it. Tiny extension saves a ton of time and super useful.
- vmception 7y ago(hi, in reference to an old thread I think you got nbomb'd on your trip)
- rhlsthrm 7y agoThe REST client extension is so awesome, ever since I figured out how to use it I've been trying to convince everyone I know to use it instead of Postman, cURL, etc. It's just so easy to save common requests to a file and have everything in my editor.
- darekkay 7y agoI've just learned about this extension today from a Twitch stream. First I thought: "Nice, another great IntelliJ IDEA feature got ported to VSCode" (I think the syntax is exactly the same). But seeing the VSCode extension was first released in 2016, it looks as if JetBrains actually copied this one. Always nice to see how IDEs/editors inspire each other.