Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable manipulation on insomnia.request - INS-3379 #7145

Merged
merged 8 commits into from
Mar 8, 2024

Conversation

ihexxa
Copy link
Contributor

@ihexxa ihexxa commented Mar 5, 2024

This change basically sets up insomnia.request for manipuating request before sending.

  • enable insomnia.request
  • added a test for it
  • add interfaces.ts for common interfaces
  • aggregate some requests to pre-request-collection.yaml

How to test

Run the following script and check if it works well:

                const { Header } = require('insomnia-collection');
                insomnia.request.method = 'GET';
                insomnia.request.url.addQueryParams('k1=v1');
                insomnia.request.headers.add(new Header({
                    key: 'Content-Type',
                    value: 'text/plain'
                }));
                insomnia.request.headers.add(new Header({
                    key: 'X-Hello',
                    value: 'hello'
                }));
                insomnia.request.body.update({
                    mode: 'raw',
                    raw: 'rawContent',
                });
                insomnia.request.auth.update(
                    {
                        type: 'bearer',
                        bearer: [
                                {key: 'token', value: 'tokenValue'},
                        ],
                    },
                    'bearer'
                );

@jackkav jackkav merged commit bdd0d42 into develop Mar 8, 2024
7 checks passed
@jackkav jackkav deleted the pre-script-set-req branch March 8, 2024 15:40
jackkav pushed a commit to jackkav/insomnia that referenced this pull request Mar 13, 2024
* feat: enable manipulation on insomnia.request

* chore: revert changes on test

* fix: lint errors

* chore: clean up dependencies

* fix: lint error

* fix: smoke test failure

* chore: fix and re-org pre-request scripts

* fix: bring back request test in smoke spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants