Skip to content

Commit

Permalink
Bump version to 0.22.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Huachao committed Jul 31, 2019
1 parent 4218664 commit bdf1309
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 21 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 0.22.0 (2019/7/31)
* __Feature__: [Add support for `GraphQL`](https://github.com/Huachao/vscode-restclient/pull/384) ([@ferronrsmith](https://github.com/ferronrsmith))
* __Feature__: [Add new system variable - local machine environment variable](https://github.com/Huachao/vscode-restclient/pull/366) ([@mtnrbq](https://github.com/mtnrbq))
* __Improvement__: [Reduce the extension size by excluding unnecessary images](https://github.com/Huachao/vscode-restclient/pull/397) ([@badre429](https://github.com/badre429))
* __Improvement__: Reduce the extension size by excluding `node_modules` directory
* __Improvement__: Replace spinner with octicon animation
* __Improvement__: Upgrade httpsnippet package to support new languages and frameworks, e.g., `PowerShell`, `Fetch API`
* __Bug Fix__: [Do not swallow last character in datetime format string](https://github.com/Huachao/vscode-restclient/issues/367)
* __Bug Fix__: [Allow request body file path contains whitespaces](https://github.com/Huachao/vscode-restclient/issues/376)
* __Bug Fix__: [Support extract JSON body with pure string payload with `$`](https://github.com/Huachao/vscode-restclient/issues/266)

## 0.21.3 (2019/5/15)
* __Breaking Change__: Remove support for setting `rest-client.showEnvironmentStatusBarItem` in favor of automatically hide status bar for non-http file feature
* __Feature__: [Support custom display formats in datetime system variable](https://github.com/Huachao/vscode-restclient/pull/361) ([@connelhooley](https://github.com/connelhooley))
Expand Down
76 changes: 56 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ REST Client allows you to send HTTP request and view the response in Visual Stud

## Main Features
* Send/Cancel/Rerun __HTTP request__ in editor and view response in a separate pane with syntax highlight
* Send __CURL command__ in editor and copy HTTP request as `CURL command`
* Send __GraphQL query__ and author __GraphQL variables__ in editor
* Send __cURL command__ in editor and copy HTTP request as `cURL command`
* Auto save and view/clear request history
* Support _MULTIPLE_ requests in the same file (separated by `###` delimiter)
* Organize _MULTIPLE_ requests in the same file (separated by `###` delimiter)
* View image response directly in pane
* Save raw response and response body only to local disk
* Fold and unfold response body
Expand All @@ -25,7 +26,7 @@ REST Client allows you to send HTTP request and view the response in Visual Stud
- Auto completion and hover support for both __environment__, __file__ and __request__ custom variables
- Diagnostic support for __request__ and __file__ custom variables
- Go to definition and find all references support _ONLY_ for __file__ custom variables
- Provide system dynamic variables `{{$guid}}`, `{{$randomInt min max}}`, `{{$timestamp [offset option]}}`, `{{$datetime rfc1123|iso8601 [offset option]}}`, and `{{$aadToken [new] [public|cn|de|us|ppe] [<domain|tenantId>] [aud:<domain|tenantId>]}}`
- Provide system dynamic variables `{{$guid}}`, `{{$randomInt min max}}`, `{{$timestamp [offset option]}}`, `{{$datetime rfc1123|iso8601 [offset option]}}`, `{{$processEnv [%]envVarName}}`, and `{{$aadToken [new] [public|cn|de|us|ppe] [<domain|tenantId>] [aud:<domain|tenantId>]}}`
- Easily create/update/delete environments and environment variables in setting file
- File variables can reference both custom and system variables
- Support environment switch
Expand Down Expand Up @@ -60,18 +61,18 @@ content-type: application/json
"time": "Wed, 21 Oct 2015 18:27:50 GMT"
}
```
Once you prepared a request, click the `Send Request` link above the request, or use shortcut `Ctrl+Alt+R`(`Cmd+Alt+R` for macOS), or right-click in the editor and then select `Send Request` in the menu, or press `F1` and then select/type `Rest Client: Send Request`, the response will be previewed in a separate __webview__ panel of Visual Studio Code. If you'd like to use the full power of searching, selecting or manipulating in Visual Studio Code, you can also preview response in __an untitled document__ by setting `rest-client.previewResponseInUntitledDocument` to `true`, by default the value is `false`. When a request is issued, ![cloud upload](https://raw.githubusercontent.com/Huachao/vscode-restclient/master/images/loading.gif) will be displayed in the status bar, after receiving the response, the icon will be changed to the duration and response size.
Once you prepared a request, click the `Send Request` link above the request, or use shortcut `Ctrl+Alt+R`(`Cmd+Alt+R` for macOS), or right-click in the editor and then select `Send Request` in the menu, or press `F1` and then select/type `Rest Client: Send Request`, the response will be previewed in a separate __webview__ panel of Visual Studio Code. If you'd like to use the full power of searching, selecting or manipulating in Visual Studio Code, you can also preview response in __an untitled document__ by setting `rest-client.previewResponseInUntitledDocument` to `true`. Once a request is issued, a waiting spin icon will be displayed in the status bar until the response is received. After that the icon will be replaced with the total duration and response size.

You can view the breakdown of the response time when hovering over the duration status bar, you could view the duration details of _Socket_, _DNS_, _TCP_, _First Byte_ and _Download_.
You can view the breakdown of the response time when hovering over the total duration in status bar, you could view the duration details of _Socket_, _DNS_, _TCP_, _First Byte_ and _Download_.

When hovering over the response size status bar, you could view the breakdown response size details of _headers_ and _body_.
When hovering over the response size in status bar, you could view the breakdown response size details of _headers_ and _body_.

> All the shortcuts in REST Client Extension are __ONLY__ available for file language mode `http` and `plaintext`.
> __Send Request__ link above each request will only be visible when the request file is in `http` mode, more details can be found in [http language section](#http-language).
### Select Request Text
You may even want to save numerous requests in the same file and execute any of them as you wish easily. REST Client extension could recognize any line begins with three or more consecutive `#` as a delimiter between requests. Place the cursor anywhere between the delimiters, issuing the request as above, and it will first parse the text between the delimiters as request and then send it out.
You may even want to save numerous requests in the same file and execute any of them as you wish easily. REST Client extension could recognize requests separated by lines begin with three or more consecutive `#` as a delimiter. Place the cursor anywhere between the delimiters, issuing the request as above, and the underlying request will be sent out.
```http
GET https://example.com/comments/1 HTTP/1.1
Expand All @@ -89,7 +90,7 @@ content-type: application/json
"time": "Wed, 21 Oct 2015 18:27:50 GMT"
}
```
`REST Client Extension` also provides another flexibility that you can use mouse to highlight the text in file as request text.
REST Client extension also provides the flexibility that you can send the request with your selected text in editor.

## Install
Press `F1`, type `ext install` then search for `rest-client`.
Expand Down Expand Up @@ -146,7 +147,7 @@ Authorization: token xxx
</request>
```

You can also specify file path to use as a body, which starts with `< `, the file path can be either in absolute or relative(relative to workspace root or current http file) formats:
You can also specify file path to use as a body, which starts with `< `, the file path(*whitepsaces* should be preserved) can be either in absolute or relative(relative to workspace root or current http file) formats:
```http
POST https://example.com/comments HTTP/1.1
Content-Type: application/xml
Expand Down Expand Up @@ -191,8 +192,44 @@ name=foo

> When your mouse is over the document link, you can `Ctrl+Click`(`Cmd+Click` for macOS) to open the file in a new tab.
## Making CURL Request
![CURL Request](https://raw.githubusercontent.com/Huachao/vscode-restclient/master/images/curl-request.png)
## Making GraphQL Request
With [GraphQL](https://www.graphql.com/) support in REST Client extension, you can author and send `GraphQL` query using the request body. Besides that you can also author GraphQL variables in the request body. GraphQL variables part in request body is optional, you also need to add a **blank line** between GraphQL query and variables if you need it.

You can specify a request as `GraphQL Request` by adding a custom request header `X-Request-Type: GraphQL` in your headers. The following code illustrates this:
```http
POST https://api.github.com/graphql
Content-Type: application/json
Authorization: Bearer xxx
X-REQUEST-TYPE: GraphQL
query ($name: String!, $owner: String!) {
repository(name: $name, owner: $owner) {
name
fullName: nameWithOwner
description
diskUsage
forkCount
stargazers(first: 5) {
totalCount
nodes {
login
name
}
}
watchers {
totalCount
}
}
}
{
"name": "vscode-restclient",
"owner": "Huachao"
}
```

## Making cURL Request
![cURL Request](https://raw.githubusercontent.com/Huachao/vscode-restclient/master/images/curl-request.png)
We add the capability to directly run [curl request](https://curl.haxx.se/) in REST Client extension. The issuing request command is the same as raw HTTP one. REST Client will automatically parse the request with specified parser.

`REST Client` doesn't fully support all the options of `cURL`, since underneath we use `request` library to send request which doesn't accept all the `cURL` options. Supported options are listed below:
Expand All @@ -211,7 +248,7 @@ Sometimes you may want to get the curl format of an http request quickly and sav
Once you want to cancel a processing request, use shortcut `Ctrl+Alt+K`(`Cmd+Alt+K` for macOS), or press `F1` and then select/type `Rest Client: Cancel Request`.

## Rerun Last Request
Sometimes you may want to refresh the API response, now you could do it simply using shortcut `Ctrl+Alt+L`(`Cmd+Alt+L` for macOS), or press `F1` and then select/type `Rest Client: Rerun Last Request` to rerun last request.
Sometimes you may want to refresh the API response, now you could do it simply using shortcut `Ctrl+Alt+L`(`Cmd+Alt+L` for macOS), or press `F1` and then select/type `Rest Client: Rerun Last Request` to rerun the last request.

## Request History
![request-history](https://raw.githubusercontent.com/Huachao/vscode-restclient/master/images/request-history.png)
Expand Down Expand Up @@ -242,7 +279,7 @@ HTTP Basic Auth is a widely used protocol for simple username/password authentic
1. Add the value of Authorization header in the base64 encoding of `username:password`.
2. Add the value of Authorization header in the raw value of `username` and `password`, which is separated by space. REST Client extension will do the base64 encoding automatically.

The corresponding examples are as follows, they are totally equivalent:
The corresponding examples are as follows, they are equivalent:
```http
GET https://httpbin.org//basic-auth/user/passwd HTTP/1.1
Authorization: Basic dXNlcjpwYXNzd2Q=
Expand Down Expand Up @@ -294,7 +331,7 @@ Azure AD is Microsoft’s multi-tenant, cloud-based directory and identity manag

## Generate Code Snippet
![Generate Code Snippet](https://raw.githubusercontent.com/Huachao/vscode-restclient/master/images/code-snippet.gif)
Once you’ve finalized your request in REST Client extension, you might want to make the same request from your own source code. We allow you to generate snippets of code in various languages and libraries that will help you achieve this. Once you prepared a request as previously, use shortcut `Ctrl+Alt+C`(`Cmd+Alt+C` for macOS), or right-click in the editor and then select `Generate Code Snippet` in the menu, or press `F1` and then select/type `Rest Client: Generate Code Snippet`, it will pop up the language pick list, as well as library list. After you selected the code snippet language/library you want, the generated code snippet will be previewed in a separate panel of Visual Studio Code, you can click the `Copy Code Snippet` icon in the tab title to copy it to clipboard.
Once you’ve finalized your request in REST Client extension, you might want to make the same request from your source code. We allow you to generate snippets of code in various languages and libraries that will help you achieve this. Once you prepared a request as previously, use shortcut `Ctrl+Alt+C`(`Cmd+Alt+C` for macOS), or right-click in the editor and then select `Generate Code Snippet` in the menu, or press `F1` and then select/type `Rest Client: Generate Code Snippet`, it will pop up the language pick list, as well as library list. After you selected the code snippet language/library you want, the generated code snippet will be previewed in a separate panel of Visual Studio Code, you can click the `Copy Code Snippet` icon in the tab title to copy it to clipboard.

## HTTP Language
Add language support for HTTP request, with features like __syntax highlight__, __auto completion__, __code lens__ and __comment support__, when writing HTTP request in Visual Studio Code. By default, the language association will be automatically activated in two cases:
Expand Down Expand Up @@ -480,18 +517,17 @@ For example: Define a shell environment variable in `.bashrc` or similar on wind
}
```

You can refer directly to the key (e.g. ```PRODSECRET```) in the script, for example if running in the production environment
You can refer directly to the key (e.g. `PRODSECRET`) in the script, for example if running in the production environment
```http
### Lookup PRODSECRET from local machine environment
# Lookup PRODSECRET from local machine environment
GET https://{{host}}/{{version}}/values/item1?user={{$processEnv USERNAME}}
Authorization: {{$processEnv PRODSECRET}}
```
or, it can be rewritten to indirectly refer to the key using an extension environment setting (e.g. ```%secret```) to be environment independent using the optional ```%``` modifier.
or, it can be rewritten to indirectly refer to the key using an extension environment setting (e.g. `%secretKey`) to be environment independent using the optional `%` modifier.
```http
### Use secretKey from extension environment settings to determine
### which local machine environment variable to use
# Use secretKey from extension environment settings to determine which local machine environment variable to use
GET https://{{host}}/{{version}}/values/item1?user={{$processEnv USERNAME}}
Authorization: {{$processEnv %secret}}
Authorization: {{$processEnv %secretKey}}
```
`envVarName`: Mandatory. Specifies the local machine environment variable

Expand Down
Binary file removed images/loading.gif
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "rest-client",
"displayName": "REST Client",
"description": "REST Client for Visual Studio Code",
"version": "0.21.3",
"version": "0.22.0",
"publisher": "humao",
"author": {
"name": "Huachao Mao",
Expand Down

0 comments on commit bdf1309

Please sign in to comment.