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.

add support to request.url_for for query parameters

See original GitHub issue

I totally misunderstood url_for’s API, I was expecting url_for('some_route', foo='bar') to return 'http://testserver/my_route/?foo=bar'.

I understand why that is now, but what is the best way to generate urls like this? (for pagination in a rest list api in this case).

Could url_for grow support for query parameters in addition to path parameters?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:31
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

18reactions
wasdeecommented, Jul 31, 2020

are there any updates?

8reactions
tomchristiecommented, Nov 11, 2019

We probably want to differentiate it more clearly from the properties on the URL class. (.params might just as well indicate a property on the class. .with_query() makes it kinda clear that it’s going to return a new URL.)

I think we probably want to end up with…

  • .query_params - A QueryParams datastructure.
  • .query_string - A raw string.
  • .with_query(...) - A new URL.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding a parameter to the URL with JavaScript - Stack Overflow
In a web application that makes use of AJAX calls, I need to submit a request but add a parameter to the end...
Read more >
An SEO Guide to URL Parameter Handling
URL parameters create duplicate content, waste crawl budget, and dilute ranking signals. Learn six ways to avoid potential SEO issues with ...
Read more >
Using Query Parameters (AWS Signature Version 4)
Authenticate requests using the query parameters to express a request entirely in a URL. ... For Amazon S3, the AWS-service string is s3...
Read more >
Filter a report using query string parameters in the URL
One way to filter it is to start with the default URL for the report, add the filter parameters to the URL, and...
Read more >
Query Parameters - Branch.io
They are extensions of the URL that are used to help define specific content or actions based on the data being passed. To...
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