Skip to content

Instantly share code, notes, and snippets.

@valachi
Created April 20, 2013 17:35
Show Gist options
  • Save valachi/5426763 to your computer and use it in GitHub Desktop.
Save valachi/5426763 to your computer and use it in GitHub Desktop.
[21] pry(main)> p = HTTPClient.new.get "http://www.kinopoisk.ru/film/277537/", nil, { 'User-Agent'=>'a', 'Accept-Encoding'=>'a' }
=> #<HTTP::Message:0xcc4c9c4
@http_body=
#<HTTP::Message::Body:0xcc4c974
@body=
"<html>\r\n<head><title>302 Found</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>302 Found</h1></center>\r\n<hr><center>nginx/1.2.1</ce
@chunk_size=nil,
@positions=nil,
@size=0>,
@http_header=
#<HTTP::Message::Headers:0xcc4c9b0
@body_charset=nil,
@body_date=nil,
@body_encoding=#<Encoding:ASCII-8BIT>,
@body_size=0,
@body_type=nil,
@chunked=false,
@dumped=false,
@header_item=
[["Server", "nginx/1.2.1"],
["Date", "Sat, 20 Apr 2013 17:35:21 GMT"],
["Content-Type", "text/html"],
["Content-Length", "160"],
["Connection", "keep-alive"],
["Keep-Alive", "timeout=60"],
["Location", "http://error.kinopoisk.ru/?ht=403"]],
@http_version="1.1",
@is_request=false,
@reason_phrase="Moved Temporarily",
@request_absolute_uri=nil,
@request_method="GET",
@request_query=nil,
@request_uri=
#<Addressable::URI:0x662662c URI:http://www.kinopoisk.ru/film/277537/>,
@status_code=302>,
@peer_cert=nil>
(END)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment