0

I want to get chunked response from server, but i can't understand - what wrong i did in this terminal log:

telnet www.google.com 80
Trying 172.217.20.36...
Connected to www.google.com.
Escape character is '^]'.
GET / HTTP/1.1
Transfer-Encoding: chunked

HTTP/1.1 302 Found
Location: http://www.google.com/sorry/index?continue=http://www.google.com/&q=EgRVjAHRGPGutfEFIhkA8aeDS1HQdWrbrx7jkGSfPgX8M5Ou6VMLMgFy
Date: Sun, 26 Jan 2020 09:10:10 GMT
Pragma: no-cache
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Content-Type: text/html; charset=UTF-8
Server: HTTP server (unknown)
Content-Length: 325
X-XSS-Protection: 0
Connection: close

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.com/sorry/index?continue=http://www.google.com/&amp;q=EgRVjAHRGPGutfEFIhkA8aeDS1HQdWrbrx7jkGSfPgX8M5Ou6VMLMgFy">here</A>.
</BODY></HTML>

I choose as option:

Transfer-Encoding: chunked

But i still get Content-Length: 325, and all content is not chunked encoded. How to make GET request with chunked encoding using telnet?

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621
  • 1
    Just because you use `telnet` to connect to the service doesn't make this question telnet related. What you're doing inside telnet is all HTTP related. – Some programmer dude Jan 26 '20 at 09:17
  • 1
    As for your problem think about what the `302` return code really means... You might want to study [HTTP](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol) a little more. – Some programmer dude Jan 26 '20 at 09:18

1 Answers1

0

1) You can't force a server to use chunked encoding in the response.

2) Setting "Transfer-Encoding" on the request means that you are sending using chunked encoding.

Julian Reschke
  • 40,156
  • 8
  • 95
  • 98