Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Прочее";
Текущий архив: 2008.06.08;
Скачать: [xml.tar.bz2];

Вниз

http протокол   Найти похожие ветки 

 
Res   (2008-04-25 22:33) [0]

Здравствуйте. Есть небольшая проблема.
Никак не могу понять, почему приходит такой ответ от некоторых хостов:

HTTP/1.1 401 Unauthorized
Date: Fri, 25 Apr 2008 17:41:09 GMT
Server: Apache/1.3.37 (Unix) PHP/5.2.3 mod_ssl/2.8.28 OpenSSL/0.9.7e-p1
X-Powered-By: PHP/5.2.3
WWW-Authenticate: Basic realm=""
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html

0


А вот например от яндекса:

HTTP/1.1 200 OK
Date: Fri, 25 Apr 2008 18:31:39 GMT
Server: Apache/1.3.29 (Unix) mod_perl/1.29 mod_deflate/1.0.21 rus/PL30.19
Set-Cookie: yandexuid=1852171209148299; path=/; domain=.yandex.ru; expires=Friday, 31-Dec-10 23:59:59 GMT
Last-Modified: Fri Apr 25 18:31:39 2008 GMT
Cache-Control: max-age=300, private, proxy-revalidate
Expires: Fri Apr 25 18:36:39 2008 GMT
Content-Length: 25498
Connection: close
Content-Type: text/html; charset=windows-1251

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">...

Непонятно, что за нули. Бывают и другие значение, не только в начале, но в конце:

HTTP/1.1 200 OK
Date: Fri, 25 Apr 2008 17:44:33 GMT
Server: Apache/1.3.37 (Unix) PHP/5.2.3 mod_ssl/2.8.28 OpenSSL/0.9.7e-p1
X-Powered-By: PHP/5.2.3
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html

49b
.....
....
.......
....
.......
......
0



 
Плохиш ©   (2008-04-26 02:30) [1]


> Никак не могу понять, почему приходит такой ответ от некоторых
> хостов:
>
> HTTP/1.1 401 Unauthorized

Хм, даже и не знаю на каких пальцах тебе это объяснять...


 
VirEx ©   (2008-04-26 05:34) [2]


> Хм, даже и не знаю на каких пальцах тебе это объяснять...

на рыбьих


 
Экс-Оригинал   (2008-04-26 20:23) [3]


> Res   (25.04.08 22:33) 


Если не знаешь английский, то возьми словарь и переведи это слово - Unauthorized.

Кратко - авторизоваться/залогиниться/зарегистрироваться нужно.


 
DiamondShark ©   (2008-04-27 08:18) [4]


> Res   (25.04.08 22:33)  

Потому что
Transfer-Encoding: chunked

Любите RFC -- источник знаний!

http://www.rfc-editor.org/rfc/rfc2068.txt


3.6 Transfer Codings

  Transfer coding values are used to indicate an encoding
  transformation that has been, can be, or may need to be applied to an
  entity-body in order to ensure "safe transport" through the network.
  This differs from a content coding in that the transfer coding is a
  property of the message, not of the original entity.

         transfer-coding         = "chunked" | transfer-extension

         transfer-extension      = token

  All transfer-coding values are case-insensitive. HTTP/1.1 uses
  transfer coding values in the Transfer-Encoding header field (section
  14.40).

  Transfer codings are analogous to the Content-Transfer-Encoding
  values of MIME , which were designed to enable safe transport of
  binary data over a 7-bit transport service. However, safe transport
  has a different focus for an 8bit-clean transfer protocol. In HTTP,
  the only unsafe characteristic of message-bodies is the difficulty in
  determining the exact body length (section 7.2.2), or the desire to
  encrypt data over a shared transport.

  The chunked encoding modifies the body of a message in order to
  transfer it as a series of chunks, each with its own size indicator,
  followed by an optional footer containing entity-header fields. This
  allows dynamically-produced content to be transferred along with the
  information necessary for the recipient to verify that it has
  received the full message.

      Chunked-Body   = *chunk
                       "0" CRLF
                       footer
                       CRLF

      chunk          = chunk-size [ chunk-ext ] CRLF
                       chunk-data CRLF

      hex-no-zero    = <HEX excluding "0">

      chunk-size     = hex-no-zero *HEX
      chunk-ext      = *( ";" chunk-ext-name [ "=" chunk-ext-value ] )
      chunk-ext-name = token
      chunk-ext-val  = token | quoted-string
      chunk-data     = chunk-size(OCTET)

      footer         = *entity-header

  The chunked encoding is ended by a zero-sized chunk followed by the
  footer, which is terminated by an empty line. The purpose of the
  footer is to provide an efficient way to supply information about an
  entity that is generated dynamically; applications MUST NOT send
  header fields in the footer which are not explicitly defined as being
  appropriate for the footer, such as Content-MD5 or future extensions
  to HTTP for digital signatures or other facilities.

  An example process for decoding a Chunked-Body is presented in
  appendix 19.4.6.

  All HTTP/1.1 applications MUST be able to receive and decode the
  "chunked" transfer coding, and MUST ignore transfer coding extensions
  they do not understand. A server which receives an entity-body with a
  transfer-coding it does not understand SHOULD return 501
  (Unimplemented), and close the connection. A server MUST NOT send
  transfer-codings to an HTTP/1.0 client.


Отсюда вывод: либо разбирай кусочный контент, либо посылай GET HTTP/1.0


> Плохиш ©   (26.04.08 02:30) [1]
> Экс-Оригинал   (26.04.08 20:23) [3]


Прежде чем выпендриваться, научитесь читать и понимать написанное.



Страницы: 1 вся ветка

Форум: "Прочее";
Текущий архив: 2008.06.08;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.47 MB
Время: 0.04 c
4-1190801074
AndreiDeJavu
2007-09-26 14:04
2008.06.08
Как инициализировать звуковую карту до загрузки Windows


15-1209039762
ekto
2008-04-24 16:22
2008.06.08
как скрыть логин/пароль БД?


2-1211117020
assassin8899
2008-05-18 17:23
2008.06.08
AdoQuery


2-1210918003
Татьяна
2008-05-16 10:06
2008.06.08
Экспорт данных в Excel


15-1208258501
Kostafey
2008-04-15 15:21
2008.06.08
Размышления о докуметировании структуры БД





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский