Skip to content

Commit e595bf1

Browse files
committed
Update README and prep for release
1 parent 45383ff commit e595bf1

File tree

6 files changed

+59
-16
lines changed

6 files changed

+59
-16
lines changed

CHANGELOG.md

+29-2
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,45 @@
1+
# v1.3.0
2+
3+
**Date:** 2024/01/20
4+
5+
### New features
6+
7+
- 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+
125
# v1.1.0
26+
227
**Date:** 2023/03/18
328

429
### New features
530

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))
732

833
# v1.0.1
34+
935
**Date:** 2023/02/19
1036

1137
Initial version
1238

1339
# v1.0.0
40+
1441
**Date:** 2023/02/18
1542

1643
~~Initial version~~
1744

18-
Pulled from NPM because of missing main file.
45+
Pulled from NPM because of missing main file.

README.md

+29-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22

33
[![npm](https://img.shields.io/npm/v/insomnia-plugin-batch-requests)](https://www.npmjs.com/package/insomnia-plugin-batch-requests) [![Coverage Status](https://coveralls.io/repos/github/jreyesr/insomnia-plugin-batch-requests/badge.svg)](https://coveralls.io/github/jreyesr/insomnia-plugin-batch-requests)
44

5-
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)
613

714
![A diagram displaying the flow of data in the plugin](images/flow.png)
815

@@ -16,34 +23,43 @@ Go to the `Application>Preferences` menu in Insomnia, then go to the `Plugins` t
1623

1724
## Usage
1825

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)
2027

2128
![A screenshot showing a template tag that marks a replacement location. It specifies the CSV column that will be used and a sample value that will be sent when manually sending the request](images/templatetag.png)
2229

30+
![A screenshot showing the configuration UI for the template tag. It contains form fields to configure the column name that will be accessed from the CSV file, and a sample value that will be sent when manually sending the request](images/templatetag_config.png)
31+
2332
When configuring the tag, set the following two values:
2433

2534
- 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)
2635
- 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.
2736

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).
2938

30-
![A screenshot showing the configuration UI for the template tag. It contains form fields to configure the column name that will be accessed from the CSV file, and a sample value that will be sent when manually sending the request](images/templatetag_config.png)
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.
3340

3441
![A screenshot showing the context menu aded by the plugin. A request has been right-clicked, and the context menu contains a new "Batch Requests" option under the Plugins section](images/context_menu.png)
3542

36-
On the plugin dialog (see the image below), you should:
43+
![A screenshot showing the main plugin UI. From top to bottom, there is a button to load a file, a table showing a preview of the data, a series of fields to specify output data, and a button to run the request multiple times](images/runner_ui.png)
44+
45+
On the plugin dialog, you should:
3746

3847
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.
3948
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.
4352

44-
![A screenshot showing the main plugin UI. From top to bottom, there is a button to load a file, a table showing a preview of the data, a series of fields to specify output data, and a button to run the request multiple times](images/runner_ui.png)
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+
![A screenshot with the extra settings marked. The settings are two numerical inputs titled "Delay in seconds" and "Parallel requests" respectively](images/extra_settings.png)
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
4561

46-
### Configuration
62+
### Global configuration
4763

4864
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.
4965

@@ -72,7 +88,7 @@ Since `v1.2.0`, there is a Global Configuration dialog in which you can select a
7288
10. Make commit.
7389
11. GOTO 6
7490
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).
7692

7793
## Releasing
7894

images/context_menu.png

100755100644
-5.22 KB
Loading

images/extra_settings.png

24.8 KB
Loading

images/runner_ui.png

100755100644
-38 KB
Loading

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"repository": {
66
"url": "https://github.com/jreyesr/insomnia-plugin-batch-requests"
77
},
8-
"version": "1.2.0",
8+
"version": "1.3.0",
99
"author": {
1010
"name": "jreyesr",
1111
"url": "https://github.com/jreyesr"

0 commit comments

Comments
 (0)