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

Not generating from multipart/form-data curl #4

Open
ViliNeto opened this issue Jan 13, 2019 · 2 comments
Open

Not generating from multipart/form-data curl #4

ViliNeto opened this issue Jan 13, 2019 · 2 comments

Comments

@ViliNeto
Copy link

ViliNeto commented Jan 13, 2019

Hi, today I tried testing for multipart/form-data cURL posting, but it didn't convert the form itself
Original curl

curl -X POST \
  https://localhost:8000/login \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \

  -F button=ok

Converted to Golang

// Generated by curl-to-Go: https://mholt.github.io/curl-to-go

req, err := http.NewRequest("POST", "https://localhost:8000/login", nil)
if err != nil {
	// handle err
}
req.Header.Set("Content-Type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW")

resp, err := http.DefaultClient.Do(req)
if err != nil {
	// handle err
}
defer resp.Body.Close()
@ViliNeto ViliNeto changed the title Not generatin multipart/form-data curl Not generating from multipart/form-data curl Jan 13, 2019
@sethgrid
Copy link
Owner

Nice find. PRs welcome. I'm slammed at work and this is a side project (and second on my list of improvements to side projects). I'm not sure I'll get to it anytime soon, but I can review PRs for sure. Thanks for the report!

@ViliNeto
Copy link
Author

No problem my friend. I will try to help the project with this improvement.
Great project, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants