Skip to content
New issue

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

Why multipart.DataFields use map[string]string to contain the request form? #22

Closed
elonzh opened this issue Mar 16, 2017 · 5 comments
Closed

Comments

@elonzh
Copy link

elonzh commented Mar 16, 2017

Normally, a form key only has single value, but it's also right with multiple values .

Why not use url.Values ?

@elonzh
Copy link
Author

elonzh commented Mar 16, 2017

If we use Body or BodyString method to make 1:n key-value pair, we need define the proper Content-Type header representing the real content MIME type.

@tomas-fp
Copy link

Clearly, this is an interface limitation. It should be map[string][]string, such as url.Values:
https://golang.org/pkg/net/url/#Values

If you want a fast fix, would you mind providing a PR? I will merge it asap!

@elonzh
Copy link
Author

elonzh commented Mar 16, 2017

I'm still reviewing and testing the code. I will try to contribute code later.

h2non added a commit that referenced this issue Mar 16, 2017
@h2non
Copy link
Owner

h2non commented Mar 16, 2017

I had a few time tonight to fix this. See: b8321b8

The fix will be shipped in gentleman@v1.0.3 soon.

@h2non
Copy link
Owner

h2non commented Mar 17, 2017

Fix was shipped in gentleman@v1.0.3. You can upgrade it running:

go get -u gopkg.in/h2non/gentleman.v1

@h2non h2non closed this as completed Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants