Why do my telnet commands fail for tinyurl.com?

1

I can send telnet command to google.com but not to tinyurl.com

On windows telnet I typed the following:

set localecho
set crlf
o tinyurl.com 80

It returns 400-bad request, why?


I know I should use HTTP 1.1 the problem is I cannot even connect to the server it closes it after sending 404 error. Why?

Rebol Tutorial

Posted 2009-08-17T18:46:13.497

Reputation: 145

Answers

2

I can get it to work here (Linux) by using HTTP 1.1 commands.

Try something along the lines of:

GET /foobar HTTP/1.1
Host: tinyurl.com

Followed, of course, by two newlines. One of the headers returned by tinyurl is

Server: TinyURL/1.6

Which suggests that they do use a custom webserver that does not accommodate HTTP 0.9/1.0 requests.

Michiel Buddingh'

Posted 2009-08-17T18:46:13.497

Reputation:

Michiel wrote "one of the headers", which is correct: http://web-sniffer.net/?url=tinyurl.com%2Ffoobar&http=1.1&rawhtml=yes&gzip=yes&type=GET&uak=0 It does support HTTP 1.0 though (when used with Host header) and should not respond with 400 Bad Request when just opening the connection. Rebol needs to provide more details about the desired request.

– Arjan – 2009-08-18T11:09:27.683

Ah, you wrote the last statement, so: you were referring to the which suggests part. (I somehow thought you were saying that the quoted header itself was false information.) You're totally right, the first header indeed indicates the server is supposed to support 1.1 and earlier. – Arjan – 2009-08-20T21:16:56.807