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 can't i add Transfer-Encoding to header #80

Open
Cs-Zzl opened this issue Jun 17, 2019 · 2 comments
Open

Why can't i add Transfer-Encoding to header #80

Cs-Zzl opened this issue Jun 17, 2019 · 2 comments

Comments

@Cs-Zzl
Copy link

Cs-Zzl commented Jun 17, 2019

	body := strings.NewReader(`xxxxxxxx`)
	opt := grequests.RequestOptions{
		Headers: map[string]string{
			"Content-Type":"multipart/form-data; boundary=xxoo",
			"Transfer-Encoding":"chunked",
		},
		RequestBody:body,
	}

The content of the request initiated by grequests is as follows

POST / HTTP/1.1
Host: xxxx.com
User-Agent: GRequests/0.10
Content-Length: 284
Content-Type: multipart/form-data; boundary=xxoo
Cookie: PHPSESSID=gjj4afltersilid2qhq7f9fcl1
Accept-Encoding: gzip, deflate
Connection: close

xxoo


Transfer-Encoding not found in the request

My question is how to add "Transfer-Encoding" to the header.

@MarkusFreitag
Copy link

While trying to reproduce it, I noticed the same behaviour using net/http. Unfortunately I have yet not figured out the actual cause for this.

@Cs-Zzl
Copy link
Author

Cs-Zzl commented Jun 18, 2019

While trying to reproduce it, I noticed the same behaviour using net/http. Unfortunately I have yet not figured out the actual cause for this.

I tried to use the net/http package to add Transfer-Encoding to the header and it failed. I don't know exactly why.

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