We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I know you can access all the parameters in a url, www.url.com/?param1=hey¶m2=three, by doing:
www.url.com/?param1=hey¶m2=three
c.req.query('param1') c.req.query('param2')
But is there anyway of just accessing an object for all the available parameters without having to know their names in advance?
The text was updated successfully, but these errors were encountered:
Hi @OultimoCoder
Make URL object from c.req.url and you can get searchParams. Do like this:
URL
c.req.url
searchParams
app.get('/', (c) => { const searchParams = new URL(c.req.url).searchParams for (const [key, value] of searchParams) { console.log(`${key} : ${value}`) } return c.text('/') })
Sorry, something went wrong.
Close this issue.
No branches or pull requests
I know you can access all the parameters in a url,
www.url.com/?param1=hey¶m2=three
, by doing:But is there anyway of just accessing an object for all the available parameters without having to know their names in advance?
The text was updated successfully, but these errors were encountered: