/rest-book

Primary LanguageTypeScriptMIT LicenseMIT

👉👉👉 This extension is still under development.

👉👉👉 Latest VS Code Insiders is required and at times this extension might be broken.

REST Book

version 0.2.4

REST Book is a Visual Studio Code extension that allows you to perform REST calls in a Notebook interface.

Features

  • Create and run REST Calls within cells.
  • Organize multiple REST Calls within one file.
  • Intermingle markdown for documenting your calls.
  • View rich HTML and image responses directly inside the Notebook.
  • Basic Authentication

Requirements

Must be using the latest version of Visual Studio Code Insiders edition.

Installation

  1. Grab the latest VSIX file from the Releases section.
  2. Inside Visual Studio Code go under the Extensions section and click on the 3 ellipsis in the top right of the pane.
  3. Click on Install from VSIX... and choose the downloaded VSIX.
  4. Close Visual Studio Code.
  5. Using Powershell or Terminal run code-insiders --enable-proposed-api rest-book <path to folder you want to run notebook in>.

Usage

  1. Create a new file to store your REST Calls with a .restbook ending.
  2. Add an code cell by hovering over the middle of the Notebook and clicking the + Code
  3. Add your intended URL as the first line of the cell. By default without specifying a method, it will be a GET call.
https://www.google.com

is equivalent to:

GET https://www.google.com

In subsequent lines immediately following the first line add any parameters or queries starting with ? or & like this:

GET https://www.google.com
    ?query="fun"
    &page=2

In the lines following without an empty line will be considered as the Request Headers:

GET https://www.google.com
    ?query="fun"
    &page=2
User-Agent: rest-book
Content-Type: application/json 

The last lines after a new line separator is the body of the call. Like the following:

POST https://www.myapi.com
User-Agent: rest-book
Content-Type: application/json 

{
    name: "Foo",
    text: "Foo is the most bar of the Foos" 
}

To test these interactions, you can play around with this simple server: SandboxServer

Known Issues

When performing an incorrect query, currently the response will be empty and not an erroneous response.

Any Other issues

Please submit your issue on the PostBox repository with exact reproduction steps.