GET with parameters not just in the URL
See original GitHub issueIn some http clients, e.g. jQuery.ajax, it’s possible to not just put the params in the URL but an object. The client will mix/concat the params into the URL later. Is that possible to give params independently like
fetch("foo.json" {
method: "get",
params: {
param1: "value1",
param2: "value2",
}
}).then(response => response.json())
to come up with a URL /foo.json¶m1=value1¶m2=value2?
Also, sometimes the params may be longer than the length limitation, so that some APIs accept GET requests with a body of parameters. So I don’t understand the reason fetch couldn’t GET with the body like
fetch("foo.json" {
method: "get",
body: {
param1: "value1",
param2: "value2",
}
}).then(response => response.json())
Will these be behaviors allowed in the future? Maybe I can submit a pull request for these.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:20
- Comments:6 (3 by maintainers)
Top Results From Across the Web
A Beginner's Guide to URL Parameters - SEMrush
In this comprehensive guide, we explore the ins and outs of URL parameters. Discover now how to use query strings without hurting your ......
Read more >Why should HTTP GET parameters be part of url
If you want to talk purely REST, then the answer is simple, it depends entirely on the protocol you wish to use. REST...
Read more >URL Get Parameter - Ryte
The getParameter() method is the HTTP request method most often used to request resources from a server through a client such as a...
Read more >GET Parameters: Definition - Seobility Wiki
GET parameters (also called URL parameters or query strings) are used when a client, such as a browser, requests a particular resource from...
Read more >How to Get URL Parameters with JavaScript - SitePoint
Here's a function to give you all the URL parameters as a neat object: function getAllUrlParams(url) { // get query string from url...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Query parameters may be encoded natively with encodeURIComponent or with jQuery.param.
How is this solved today?