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

query parameters not available when invalid url #8498

Closed
arthurvanl opened this issue Mar 20, 2025 · 7 comments
Closed

query parameters not available when invalid url #8498

arthurvanl opened this issue Mar 20, 2025 · 7 comments
Assignees

Comments

@arthurvanl
Copy link

arthurvanl commented Mar 20, 2025

Image
I do not get the query parameters when invalid url.

Code used:

console.log(insomnia.request.url.toString())
@ihexxa
Copy link
Contributor

ihexxa commented Mar 21, 2025

Hi @arthurvanl , in the previous thread, you mentioned that you would like to manipulate query params even the url is not incompleted. I guess we might be able to provide this capability. But as you know, sometimes the url could be unstandard or incomplete then it can't be parsed correctly, which also includes query params in the url. This may introduce some unreliable factors.

I notice that you've detected several alternative solutions such as path parameters. Based on the potential unreliable reason I mentioned above, I'm thinking if the parsing invalid url solution is the optimal one for your case or there could be some other better approaches?

@arthurvanl
Copy link
Author

Hi @ihexxa

We could easily solve this issue if the queryParameters could be get the same as pathParameters. I think we should store the query params apart from the url, same as path params does.

@ihexxa
Copy link
Contributor

ihexxa commented Mar 24, 2025

Hi @ihexxa

We could easily solve this issue if the queryParameters could be get the same as pathParameters. I think we should store the query params apart from the url, same as path params does.

Awesome.
We may be able to expose query params separatedly. However, in some case, user could also specify query params with an invalid url (invalid?q=1), then Insomnia is not able to parse it and expose them together with ones specified on UI.

@arthurvanl
Copy link
Author

Why can it not be exposed before the url is validated?
Postman has this aswell. The base url changes for me based on an environment variable (made possible in pre-request script)

@ihexxa
Copy link
Contributor

ihexxa commented Mar 25, 2025

This is true, Postman is able to parse this case, but the problem is it doesn't work well for some other invalid ones, for example, a=b (only specifying query param) or user@gmail.com:password (credential only), so it is not always reliable. From app's perspective, it could affect other users.

@arthurvanl
Copy link
Author

Well because of this problem I have to switch back to postman. Would be awesome if a fix comes to replace this problem.

@ihexxa
Copy link
Contributor

ihexxa commented Mar 26, 2025

Will check and reopen this thread if there's a a better solution.

@ihexxa ihexxa closed this as completed Mar 26, 2025
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

2 participants