Skip to content

Feature Request: Allow to use a new request in before-try event handler #791

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

Closed
IanSun opened this issue Aug 2, 2022 · 3 comments
Closed

Comments

@IanSun
Copy link

IanSun commented Aug 2, 2022

Currently, before-try event provides a Request object and use that object to make a request.
It's impossible to modify the body and the query of the request for now because of these properties are read only.

Background is, I want to make a request with arbitrary query strings. This hasn't been supported by current spec. I tried to set the parameter key to an empty string according to this comment. RapiDoc renders well. However, it stills prepend the = symbol when I click "Try". I know that is a correct behaviour but what I hope is to provide a way to modify the url to meet my design.

@mrin9
Copy link
Collaborator

mrin9 commented Sep 9, 2022

Update: we are still discussing this use-case as we like to take care of some of our own use-cases

@mrin9 mrin9 closed this as completed in d26602d Sep 18, 2022
@mrin9
Copy link
Collaborator

mrin9 commented Sep 18, 2022

You may now update/append url, url-params, method, request-body, headers in before-try event. For more info/usage check our API section.

The feature is still experimental , collecting our user feedback on this

@alex-albericio
Copy link

We need to replace the url for a special use case. I've tested the new code at it works as expected (although I had to change the version in package.json from 9.3.4.beta to 9.3.4-beta.0 because npm complained with invalid version).

@mrin9 do you plan to include this feature in the next release? Any ETA for that?

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

No branches or pull requests

3 participants