Тема: http
Показать сообщение отдельно

  #3  
Старый 29.07.2009, 19:39
_artem_
Участник форума
Регистрация: 27.07.2005
Сообщений: 130
С нами: 10942207

Репутация: 80
По умолчанию

HTTP/1.1 требует за собой указание Host: хост.

пример

Код:
nc -v localhost 80

POST /1.php HTTP/1.1
Host: localhost
Content-type: application/x-www-form-urlencoded
Content-length: 10

blabla=123
ответ сервака:
Код:
HTTP/1.1 200 OK
Date: Wed, 29 Jul 2009 15:34 GMT
Server: Apache/2.2.11 (Unix) PHP/5.3.0
X-Powered-By: PHP/5.3.0
Content-Length: 195
Content-Type: text/html

<html>
<head>
<title>form</form>
</head>
<body>
<form action="1.php" method="POST">
<input type=text" name="blabla" id="blabla" value="123"><input type="submit">
</form>
</body>
</html>
ответ без указание хоста

Код:
HTTP/1.1 400 Bad Request
...
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>
п.с. надо бы знать разницу между HTTP/1.0 и 1.1 !!!!!!!!!
 
Ответить с цитированием