-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Support for multi-value parameters in Query string #13357
Comments
Hey, there @kingferiol 👋. I think I understand the context of what you're looking to do here, but let me know if I'm missing something. You should be able to construct the string yourself by using comma delimited values similar to the following:
If this doesn't solve what you're looking for, can you clarify what the use case here is or add more context? Thanks. |
Is there potential to support the |
The workaround would be creating search params manually, const values = ["value1", "value2"...]
await get({
apiName,
path: `/some_path?paramA=${values.join('¶mA=')}`,
}) As defined in resolveApiUrl it does not consider the possibility of multi value params yet... I would allow adding native URLSearchParams property in options for maximum flexibility. |
Thanks for the suggestion. Ended up going this route as well and it is working. |
Hi all. Thanks for the answer. Finally I implemented the @kolodi workaround. Adding the query string parameter into the path attribute. Thanks |
@kingferiol, thanks for confirming that you got it working and apologies on the delayed response to this issue. We'll close it, but let us know if there's further questions on this (or feel free to open a new issue). Thanks! |
Before opening, please confirm:
JavaScript Framework
React
Amplify APIs
REST API
Amplify Version
v6
Amplify Categories
api
Backend
None
Environment information
Describe the bug
Hi all
I am trying to create a GET Request with a query string parameter that has multiple values
https://mydomanin.com/path?paramA=value1¶mA=value2
Considering this interface (Record<string, string>) we should add the same key twice.
Is there any workaround?
Thanks for the support
Best
Expected behavior
Create an HTTP request with multiple value in query string
https://mydomanin.com/path?paramA=value1¶mA=value2
Reproduction steps
n.a.
Code Snippet
// Put your code below this line.
Log output
aws-exports.js
No response
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: