-
Notifications
You must be signed in to change notification settings - Fork 23
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
Nodejs parsing for query params #249
Comments
using NodeJS Script should work.
You could rename your Multiple line variable definitions are really hard to parse without explicit end separator. Is a empty line or comment a end of variable definition or just some formatting modification. This parsing would be unstable. I would just use NodeJS Scripts for this use case. |
Hey there @AnWeber, thanks for being responsive, you're amazing! So about what you just suggested:
It kinda works, but there is some hiccup: It works if the GET {{apiHost}}/api/v1/entities?{{ids.map(x => `id=${x}`).join('&')}} leading effectively to (when evaluated by httpyac): GET https://my-api.com/api/v1/entities?id=21720000&id=21100000&id=21100100&id=21300000&id=21200000&id=21302000&id=21310000&id=24020500&id=24020598 That being said, when it's on new line: GET {{apiHost}}/api/v1/entities
?{{ids.map(x => `id=${x}`).join('&')}} It ends being interpreted:
It's like the extra line messing things which oddly-enough isn't the case with the "Workaround 1: Full verbose variables" I mentioned in my original post, do you know what that might be the case? |
Yes, I just noticed that too, the parser for the URL is probably not quite right. I'll have to have a look at the regex.
|
Nice! Can't wait 🪩💃! |
I released a update containing these fixes. |
🙋♀️ Hello, it's again wee me!
Context
I have to deal some API (not mine), and the query params can pretty verbose I found only two ways to handle this case but none of them make things conveninent from my point of view:
Workarounds
Workaround 1: Full verbose variables
But as you can see, it's super verbose and time-consuming to type all the ids😕
Workaround 2: Nodejs script
So this works, but I see 2 main caveats:
Proposal
But it doesn't seem to work 🤔
If something similar is already available, please feel free to point me towards that solution.
Also would love some support for multiple lines variable definitions, e.g.,
Wdyt?
The text was updated successfully, but these errors were encountered: