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
- Add a configuration option to set default delay for all requests ([#11](https://github.com/jreyesr/insomnia-plugin-batch-requests/pull/11))
8
+
9
+
# v1.2.0
10
+
11
+
**Date:** 2023/03/21
12
+
13
+
### New features
14
+
15
+
- Add a configuration option to set default delay for all requests ([#7](https://github.com/jreyesr/insomnia-plugin-batch-requests/pull/7))
16
+
17
+
# v1.1.1
18
+
19
+
**Date:** 2023/03/21
20
+
21
+
### Bugfixes
22
+
23
+
- Fix plugin freezing after sending the first request when response isn't valid JSON ([#4](https://github.com/jreyesr/insomnia-plugin-batch-requests/issues/4))
24
+
1
25
# v1.1.0
26
+
2
27
**Date:** 2023/03/18
3
28
4
29
### New features
5
30
6
-
* Added a configuration option to set a delay between consecutive requests ([#1](https://github.com/jreyesr/insomnia-plugin-batch-requests/issues/1))
31
+
- Added a configuration option to set a delay between consecutive requests ([#1](https://github.com/jreyesr/insomnia-plugin-batch-requests/issues/1))
The Batch Requests plugin for [Insomnia](https://insomnia.rest) adds a context menu option that lets you send a request repeatedly, changing parts of every request by variable data, taken from a CSV file. For every response, some data can be collected and added to the CSV file. See below for a diagram:
5
+
The Batch Requests plugin for [Insomnia](https://insomnia.rest) adds the ability to send a request repeatedly, changing parts of every request by variable data, taken from a CSV file. For every response, some data can be collected and added to the CSV file.
6
+
7
+
- Repeatedly send a request by reading data from a CSV file
8
+
- Extract data from JSON responses and write it back to the CSV file
9
+
- Works well if not using the plugin (when sending the request manually)
10
+
- Add a delay between each request
11
+
- Run multiple requests in parallel
12
+
- Supports non-JSON responses too (but can't extract response data in such cases)
6
13
7
14

8
15
@@ -16,34 +23,43 @@ Go to the `Application>Preferences` menu in Insomnia, then go to the `Plugins` t
16
23
17
24
## Usage
18
25
19
-
The plugin adds a template tag to mark the places that you want to replace. To add it, press `Ctrl+Space`, search for the `Batch` tag and press `Enter`. Then, double click the tag to configure it.
26
+
The plugin adds a template tag to mark the places that you want to replace. To add it, press `Ctrl+Space`, search for the `Batch` tag and press `Enter`. Then, double click the tag to configure it. The tag can be inserted anywhere in the request (e.g. in the URL, query parameters, headers, or body)
20
27
21
28

22
29
30
+

31
+
23
32
When configuring the tag, set the following two values:
24
33
25
34
- The name of the CSV column that will be replaced in this tag's location. Copy it from the first line of the CSV file, exactly (including capitalization)
26
35
- A sample value. This value will be used when sending the request manually. This is the value that you would have to edit manually if this plugin did not exist.
27
36
28
-
The live preview will always show the value of the `Sample value` field. The value will only vary when sending the request via the Batch Request dropdown option (see below).
37
+
The live preview will always show the value of the `Sample value` field, and this same value will be replaced when sending the request manually (e.g. via Insomnia's main Send button) The value will only vary when sending the request via the Batch Request dropdown option (see below).
29
38
30
-

31
-
32
-
The plugin also adds a context menu option to all requests. To see it, right-click a request, then select the `Batch Requests` option under the `Plugins` section. This will open the plugin dialog.
39
+
The plugin also adds a context menu option to all requests. To see it, click on the dropdown arrow to the right of a request on the sidebar, then select the `Batch Requests` option. This will open the plugin dialog.
33
40
34
41

35
42
36
-
On the plugin dialog (see the image below), you should:
43
+

44
+
45
+
On the plugin dialog, you should:
37
46
38
47
1. Select a CSV file using the button. The file should have one column for each different placeholder/template tag that you have selected, plus one column for each result that you want to extract from the responses. The response/output columns can be empty, since they will be filled by the plugin.
39
48
2. Review the loaded data in the table. It will show the first five rows of the CSV file. It is provided as a sanity check, so that you can verify that the CSV is being parsed correctly.
40
-
3. Configure the data that you want to output by adding `Outputs`. For each one, use the dropdown on the left to specify a CSV column, and write a JSONPath expression in the text field on the right. In the image below, the `$.total` field will be extracted to the `sales` column in the CSV file.
41
-
4. Click the `Run!` button at the bottom of the dialog. It will only become active when you have chosen a file and provided at least one Output.
42
-
5. Click the `Save` button to write the extracted data back to the CSV file, if you need it.
49
+
3.(Optional) Configure the data that you want to output by adding `Outputs`. For each one, use the dropdown on the left to specify a CSV column, and write a JSONPath expression in the text field on the right. In the image below, the `$.total` field will be written to the `sales` column in the CSV file. This plugin uses [the `jsonpath-plus` syntax](https://www.npmjs.com/package/jsonpath-plus), which is [also used by Insomnia](https://docs.insomnia.rest/insomnia/responses#filter)
50
+
4. Click the `Run!` button at the bottom of the dialog. It will only become active when you have chosen a file and (if any outputs exist) completely filled all Outputs.
51
+
5. Click the `Save` button to write the extracted data back to the CSV file, if you need it. Wait until all requests have been performed (as indicated by the progress bar) before clicking this button.
43
52
44
-

53
+
### Extra settings
54
+
55
+
There are two additional options that can be set when sending batch requests. They appear in the **Run Config** section, above the progress bar:
56
+
57
+

58
+
59
+
-**Delay in seconds** (available since `v1.1.0`): Inserts a delay _before_ sending each request. It's useful if the remote API enforces a rate limit or it's otherwise desired to throttle requests. By default it's set to 0. Can also be altered for the entire Request Collection (see [below](#global-configuration))
60
+
-**Parallel requests** (available since `v1.3.0`): Controls the number of requests that can be in flight at the same time. If set to a value greater than 1, it'll send multiple requests in parallel. Once a request is done, another one will start. By default it's set to 1
45
61
46
-
### Configuration
62
+
### Global configuration
47
63
48
64
Since `v1.2.0`, there is a Global Configuration dialog in which you can select a default request delay, in case you usually work with servers that require a delay between requests.
49
65
@@ -72,7 +88,7 @@ Since `v1.2.0`, there is a Global Configuration dialog in which you can select a
72
88
10. Make commit.
73
89
11. GOTO 6
74
90
12. Update the package version in `package.json`.
75
-
13. When done, submit a PR and merge it. The CD should pick it up, compile a package and upload it to NPM.
91
+
13. When done, submit a PR and merge it. If releasing a new version, see [the next section](#releasing).
0 commit comments