HTTP Client is an extension for the Nova editor to make HTTP calls from a *.http file.
Includes:
- HTTP Syntax highlighting
 - Auto-completion for many HTTP Headers and their standard values
 - File and request-scoped variables
 - Run HTTP command
 - Run HTTP task
 - Sidebar with request history
 
HTTP Client tries to be compatible to the very popular REST Client extension of VS Code, however it supports only a small subset of its features, yet.
- 
Install the extension from the Nova extensions library.
 - 
Create a file with "http" extension, or select the HTTP Language in the current editor
 - 
Write a HTTP verb and URL in a line:
 
GET https://wikipedia.org
- 
Put the cursor on the line and press CMD-R or right-click and select the "Run HTTP" command
 - 
HTTP Client will open a new editor with the result of the request (HTTP & body). It detects if the response is HTML, JSON or XML and selects the appropriate syntax in Nova.
 
In the editor, type an HTTP request by starting with a HTTP verb (all UPPERCASE):
GET https://postman-echo.com/get
GET https://postman-echo.com/get
x-api-key: test
x-version: 1.0
Some headers will be automatically added to the request, but you can overwrite them.
Separate the body with an empty line after URL/headers:
POST https://postman-echo.com/post
Content-Type: application/json
{
  "name": "louis77"
}
You can also specify a file path to use as a body, which starts with <.
It will try to read the file and use it as the body.
POST https://postman-echo.com/post
Content-Type: application/json
< /home/joe/payload.json
Separate multiple request in the same file with ### on a separate line.
You can also add some text to name your requests. If you just type s a Clip will popup.
Place the cursor anywhere inside a request when running it.
GET https://postman-echo.com/get
x-api-key: test
x-version: 1.0
### My request
POST https://postman-echo.com/post
Content-Type: application/json
{
  "name": "louis77"
}
HTTP Client support the definition and usage of file and request-scoped variables.
File variables are defined at the beginning of the file or inside a block (separated by ###) which does not contain a request.
Request-scoped variables are defined at the beginning of a request block.
@echoUrl = https://httpbin.org     <--- file variable
### GET anything
@method = get     <--- request-scoped variable
GET {{echoUrl}/@method
### another global block
@key = test    <--- file variable, available from this point on
### 
GET {{echoUrl}}/get
x-api-key: {{key}} 
In this example, echoUrl is a file variable which is available to all requests after it is defined. methodis a request-scoped variable which is only available in the request block it was defined.
Variable substitution with {{variable}} works for subsequent variable values, request URLs, and header values:
@baseURL = http://localhost:8080
@basePath = {{baseURL}}/api
@type = application/json
GET {{basePath}}
Content-Type: {{type}}
You have several options to execute the current HTTP request:
- Right-click and select "Run HTTP"
 - Press CMD-R
 - Bring up the command palette (CMD-SHIFT-P) and search for "Run HTTP"
 - Click on the "Run HTTP Task" run button
 - Use the menu "Editor > Run HTTP"
 
The cursor must always be anywhere inside an HTTP request.
HTTP Client features a sidebar to list your request history:
This extension provides a few settings to customize its behaviour:
- Follow Redirects (3xx responses) (default: true)
 - Specify a timeout for requests
 
- Non text-based responses (i.e. binary, images) are not supported yet
 
Let me know if you find the extension useful and what features you want to see.
- Option to include request (w/o body) in response output
 - Look for a global "requests.http" to populate Task list
 - Open response document immediately and populate incrementally
 - Environment variables
 - Variables defined via settings
 - Run multiple requests at once
 
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
 - Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
 
If you like this extension and want it to get better over time, please consider showing your appreciation by donating a small tip. Thank you!
Distributed under the GPL-3-or-later. See LICENSE.txt for more information.
Louis Brauer - @BrauerLouis1 - [email protected]
Project Link: https://github.com/louis77/nova-http-client
  
