You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGELOG.md
+12-1
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,15 @@
1
-
## 0.12.2 (2017/2/22)
1
+
## 0.13.0 (2017/3/20)
2
+
*__Feature__: Allow preview response in untitled document directly to use the full power of VS Code to search, select or manipulate the response
3
+
*__Feature__: Support saving response body to corresponding file according to response MIME type, and also provide setting `rest-client.mimeAndFileExtensionMapping` to overwrite the saved file extension
4
+
*__Feature__: Display break down response timing details(_Socket_, _DNS_, _TCP_, _First Byte_ and _Download_) in tooltip of duration status bar
5
+
*__Feature__: Display breakdown response size(_headers_ and _body_) in tooltip of size status bar
6
+
*__Bug Fix__: [Fix auto completion not working sometimes](https://github.com/Huachao/vscode-restclient/issues/76)
Copy file name to clipboardexpand all lines: README.md
+34-8
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ REST Client allows you to send HTTP request and view the response in Visual Stud
10
10
* Auto save and view/clear request history
11
11
* Support _MULTIPLE_ requests in the same file
12
12
* View image response directly in pane
13
-
* Save raw response to local disk
13
+
* Save raw response and response body only to local disk
14
14
* Customize font(size/family/weight) in response preview
15
15
* Environments and custom/global system variables support
16
16
- Use custom/global variables in any place of request(_URL_, _Headers_, _Body_)
@@ -45,7 +45,7 @@ content-type: application/json
45
45
"time": "Wed, 21 Oct 2015 18:27:50 GMT"
46
46
}
47
47
```
48
-
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 panel of Visual Studio Code. When a request is issued,  will be displayed in the status bar, after receiving the response, the icon will be changed to the duration and response size.
48
+
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,  will be displayed in the status bar, after receiving the response, the icon will be changed to the duration and response size. When hovering over the duration status bar, you could view the breakdown 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_.
49
49
50
50
> All the shortcuts in REST Client Extension are __ONLY__ available for file language mode `http` and `plaintext`.
51
51
@@ -125,22 +125,39 @@ Authorization: token xxx
125
125
</request>
126
126
```
127
127
128
-
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 current http file) formats:
128
+
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:
129
129
```http
130
130
POST https://example.com/comments HTTP/1.1
131
-
content-type: application/xml
132
-
authorization: token xxx
131
+
Content-Type: application/xml
132
+
Authorization: token xxx
133
133
134
134
< C:\Users\Default\Desktop\demo.xml
135
135
```
136
136
```http
137
137
POST https://example.com/comments HTTP/1.1
138
-
content-type: application/xml
139
-
authorization: token xxx
138
+
Content-Type: application/xml
139
+
Authorization: token xxx
140
140
141
141
< ./demo.xml
142
142
```
143
143
144
+
When content type of request body is `multipart/form-data`, you may have the mixed format of the request body like following:
Once you want to cancel a processing request, use shortcut `Ctrl+Alt+Q`(`Cmd+Alt+Q` for macOS), or press `F1` and then select/type `Rest Client: Cancel Request`.
146
163
@@ -161,6 +178,13 @@ You can also clear request history by pressing `F1` and then selecting/typing `R
161
178

162
179
In the upper right corner of the response preview tab, we add a new icon to save the latest response to local file system. After you click the `Save Response` icon, it will prompt the window with the saved response file path. You can click the `Open` button to open the saved response file in current workspace, or click `Copy Path` to copy the saved response path to clipboard.
163
180
181
+
Another icon in the upper right corner of the response preview tab is the `Save Response Body` button, it will only save the response body __ONLY__ to local file system. The saved file extension is set according to the response MIME type, like if the `Content-Type` value in response header is `application/json`, the saved file will be with extension `.json`. You can also overwrite the MIME type and extension mapping to your requirement with the `rest-client.mimeAndFileExtensionMapping` setting.
182
+
```json
183
+
"rest-client.mimeAndFileExtensionMapping": {
184
+
"application/atom+xml": "xml"
185
+
}
186
+
```
187
+
164
188
## Generate Code Snippet
165
189

166
190
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.
@@ -185,7 +209,7 @@ Currently auto completion will be enabled for following five categories:
185
209
6. MIME Types for `Accept` and `Content-Type` headers
186
210
187
211
## Environments and Variables
188
-
Environments give you the ability to customize requests using variables, and you can easily switch environment without chaning requests in `http` file. A common usage is having different configurations for different product environments, like devbox, sandbox and production.
212
+
Environments give you the ability to customize requests using variables, and you can easily switch environment without changing requests in `http` file. A common usage is having different configurations for different product environments, like devbox, sandbox and production.
189
213
190
214
Environments and variables of `REST Client Extension` are defined in setting file of `Visual Studio Code`, so you can create/update/delete environments and variables at any time you wish. The changes will take effect right away. If you __DO NOT__ want to use any environment, you can choose `No Environment` in the environments list. We also support two types of variables: __Global System Variables__ and __Environment Custom Variables__. You can use them in the same way: `{{VariableName}}`. Below is a sample piece of setting file for custom environments and variables:
191
215
```json
@@ -267,6 +291,8 @@ REST Client Extension adds the ability to control the font family, size and weig
267
291
*`rest-client.fontFamily`: Controls the font family used in the response preview. (Default is __Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback"__)
268
292
*`rest-client.fontWeight`: Controls the font weight used in the response preview. (Default is __normal__)
269
293
*`rest-client.environmentVariables`: Sets the environments and custom variables belongs to it (e.g., `{"production": {"host": "api.example.com"}, "sandbox":{"host":"sandbox.api.example.com"}}`). (Default is __{}__)
294
+
*`rest-client.mimeAndFileExtensionMapping`: Sets the custom mapping of mime type and file extension of saved response body. (Default is __{}__)
295
+
*`rest-client.previewResponseInUntitledDocument`: Preview response in untitled document if set to true, otherwise displayed in html view. (Default is __false__)
270
296
271
297
Rest Client respects the proxy settings made for Visual Studio Code (`http.proxy` and `http.proxyStrictSSL`).
0 commit comments