question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

request.query_params & request.url missing query params

See original GitHub issue

Hey,

I have a simple test app (starlette==0.13.0) running and I noticed that requests only contain the first query parameter. All subsequent query params are trimmed out of the request url & query params:

curl http://localhost:8000/v1/posts?foo=bar&show=yes&test=1

The resulting request object in my view shows this:

URL('http://localhost:8000/v1/posts?foo=bar')
QueryParams('foo=bar')

image image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
hoIIercommented, Dec 9, 2019

ohhh wow, son of a gun! that’s it 😊 sigh, my bad! thanks for helping get to the bottom of it!

2reactions
tomchristiecommented, Dec 9, 2019

Found it 🤣 It’s a scripting issue…

$ curl http://localhost:8000/v1/posts?foo=bar&test=1&yes=true
                                             ^ Ampersand is a special character.

This is actually being interperated as:

  • curl http://localhost:8000/v1/posts?foo=bar
  • test=1
  • yes=true

Try echo $test; echo $yes and you’ll see what I mean.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing query parameter in request - Stack Overflow
Query returns the keyed url query value if it exists, otherwise it returns an empty string ("") . It is shortcut for c.Request.URL.Query()....
Read more >
Query parameters for a returnUrl are lost - YouTube
Upon redirect after a successful login, my query parameters on original requested url gets lost.Example:Registered Client with RedirectUri: ...
Read more >
Add Query Parameters to a GET Request URL in Postman
We'll walk through simply editing the URL in the address bar, then use the Query Parameters table fields to update the parameters by...
Read more >
Extracting Request Parameters
Query parameters are extracted from the request URI query parameters, and are specified by using the javax.ws.rs.QueryParam annotation in the method parameter ...
Read more >
GET Request Query Parameters with Flask - Stack Abuse
If you search for a non-existent key - a None is returned. This way, you can check whether a query parameter is missing,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found