grequests icon indicating copy to clipboard operation
grequests copied to clipboard

Why can't i add Transfer-Encoding to header

Open Cs-Zzl opened this issue 6 years ago • 2 comments

	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.

Cs-Zzl avatar Jun 17 '19 09:06 Cs-Zzl

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.

MarkusFreitag avatar Jun 17 '19 14:06 MarkusFreitag

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.

Cs-Zzl avatar Jun 18 '19 06:06 Cs-Zzl