Open kingferiol opened 6 months ago
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:
var a = new URL('https://mydomanin.com/path?paramA=value1,value2')
a.searchParams.get('paramA')
'value1,value2'
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 paramsSerializer
config like in axios?
The workaround would be creating search params manually, example get requests
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
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
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