Comments (13)
I have added the support. It's available on master. Give it a try and let me know.
from resty.
Has the function name changed overtime? It seems it is "SetQueryParamsFromValues" now.
from resty.
Just had a look. It seem these two lines L50 and L53 requires change from method Set
to method Add
.
Would like to you send PR or I can do it over weekend?
from resty.
I tried it, it didn't work, i looked further in net/url package, it is also a dictionary, so either way it will not work.
// Set sets the key to value. It replaces any existing
// values.
func (v Values) Set(key, value string) {
v[key] = []string{value}
}
// Add adds the value to key. It appends to any existing
// values associated with key.
func (v Values) Add(key, value string) {
v[key] = append(v[key], value)
}
from resty.
see this, https://golang.org/pkg/net/url/
func (Values) Add
func (v Values) Add(key, value string)
Add adds the value to key. It appends to any existing values associated with key.
from resty.
Update:
@guohuang I will add this support by today and let you know.
You're correct. Yes query param name is unique in the URI, as per URI RFC.
So as per RFC, you can get multi-value after changing those two lines I mentioned above.
for e.g.: ?status=pending&status=approved
from resty.
@guohuang I have updated the comment.
from resty.
yes, we can always use ?status=pending,approved
as work around, but we want ?status=pending&status=approved
, looking at https://github.com/go-resty/resty/blob/master/request.go#L91, your proposed solution doesn't work, as QueryParam is a dictionary.
from resty.
I will add this support, also I have updated the previous comment. Once done I will update this issue.
from resty.
yup, it works! thanks for the quick fix!
from resty.
Nice. I'm closing this one.
from resty.
BTW, I have added this new method SetMultiValueQueryParams.
from resty.
Nice! you are really quick and professional!
from resty.
Related Issues (20)
- Call to http.DetectContentType has trailing NUL bytes in buffer HOT 1
- The SetContentLength(boo) method may cause an out-of-memory issue when uploading large files, such as 5GB. HOT 1
- CVE-2023-45286 HOT 3
- Breaks application from Ctrl-C handling HOT 1
- Brotli support HOT 1
- How to handle response if a call to API returns 200 with struct A, or 201 with struct B? HOT 3
- SetResult failed with httpmock HOT 2
- CVE-2023-45286: HTTP request body disclosure HOT 3
- SetProxy HOT 3
- The request with SetFileReader retry time great than 1 will has issues HOT 1
- Signing requests with path parameters HOT 1
- Clone or copy of existing client HOT 6
- cache middleware HOT 4
- retrying of non-idempotent methods HOT 2
- Path param encoding is broken
- can't use image.decode on rawbody HOT 1
- Can it support socket5 proxy?
- Resty retry function does not work in Slack as custom http client
- Middleware around resty.Request.Execute including retries
- about proxy
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resty.