You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Albretch Mueller <lb...@gmail.com> on 2013/05/07 05:03:30 UTC

why are so different the response headers as reported by wget and httpclient?

~
 and what do you have to do get the same or a similar response in
order to strategize around the "HTTP/1.1 302 Moved Temporarily" using
httpclient?
~
 thanks,
 lbrtchx
~
// __ wget

$ wget --server-response --spider
"http://download.ted.com/talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD"
Spider mode enabled. Check if remote file exists.
--2013-05-06 22:51:07--
http://download.ted.com/talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD
Resolving download.ted.com (download.ted.com)... 54.242.198.180
Connecting to download.ted.com
(download.ted.com)|54.242.198.180|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 302 Moved Temporarily
  Server: nginx
  Date: Tue, 07 May 2013 02:51:22 GMT
  Content-Type: text/html
  Connection: keep-alive
  X-Cache: HIT
  Location: http://video.ted.com/talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4
Location: http://video.ted.com/talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4
[following]
Spider mode enabled. Check if remote file exists.
--2013-05-06 22:51:08--
http://video.ted.com/talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4
Resolving video.ted.com (video.ted.com)... 4.27.18.254, 8.254.54.254
Connecting to video.ted.com (video.ted.com)|4.27.18.254|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Cache-Control: public, max-age=31536000
  Date: Tue, 07 May 2013 02:51:22 GMT
  Content-Length: 116040512
  Content-Type: video/mp4
  ETag: "72d080c60cb8fdd4add7187d3ffedcd3"
  Expires: Sun, 27 Apr 2014 13:47:31 GMT
  Last-Modified: Sat, 11 Aug 2012 01:47:29 GMT
  Accept-Ranges: bytes
  Server: AmazonS3
  x-amz-id-2: g2uS6EA5QCq8d0uwrem9QQueXR+L8lHNj85ePL1WD8Ju6iV94J3QuRGsCdqPgTMN
  x-amz-request-id: F83B24FCD7D43060
  Connection: keep-alive
Length: 116040512 (111M) [video/mp4]
Remote file exists.
~
// __ httpclient

// __ |http://download.ted.com/talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD|
// __ httpResponse.getStatusLine().toString(): |HTTP/1.1 404 Not Found|
// __  7 response headers received from server:
// __ Server: Footprint 4.8/FPMCP
// __ Mime-Version: 1.0
// __ Date: Tue, 07 May 2013 02:44:01 GMT
// __ Content-Type: text/html
// __ Content-Length: 633
// __ Expires: Tue, 07 May 2013 02:44:01 GMT
// __ Connection: close
~

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: why are so different the response headers as reported by wget and httpclient?

Posted by "Stephen J. Butler" <st...@gmail.com>.
On Tue, May 7, 2013 at 4:15 PM, Albretch Mueller <lb...@gmail.com> wrote:

>  1) even if, since all I need are the headers, for which I "only" need to
> go:
>
>   Header[] RspnsHdrs = httpResponse.getAllHeaders();
> // __ closing underlying stream (just getting all HTTP headers for
> this URL's connection)
>  InputStream IS = httpEnt.getContent();
>  IS.close();
>
>  the InputStream is taking like a minute to actually close. Why is
> that happening?
>
>  It seems once you go "GET ..." the server does as you tell it and
> sends the data anyway, which seems to be patiently swallowed by HC,
> even if the data is not saved to local storage
>
>  Is there a way to just get the headers and the negotiation without
> the actual payload? (like the spider option of wget)
>

A HEAD request, instead of GET, should return just the headers. Although
I'm not a 100% sure about that... the server might still be allowed to
respond with a body for a HEAD request.

Either way, use EntityUtils.consumeQuietly(ent) is the best way to handle
unwanted entity content. Just closing the input stream is a little rude.

Re: why are so different the response headers as reported by wget and httpclient?

Posted by Albretch Mueller <lb...@gmail.com>.
> I'd suggest you not set the Host header manually ...

 That did it! HC is seamlessly handling redirection, yet I still have
2 questions:

 1) even if, since all I need are the headers, for which I "only" need to go:

  Header[] RspnsHdrs = httpResponse.getAllHeaders();
// __ closing underlying stream (just getting all HTTP headers for
this URL's connection)
 InputStream IS = httpEnt.getContent();
 IS.close();

 the InputStream is taking like a minute to actually close. Why is
that happening?

 It seems once you go "GET ..." the server does as you tell it and
sends the data anyway, which seems to be patiently swallowed by HC,
even if the data is not saved to local storage

 Is there a way to just get the headers and the negotiation without
the actual payload? (like the spider option of wget)

 2) What is the listener interface you need to implement to replicate
with HC what you get from the wire log via commons logging?

 Thanks,
 lbrtchx

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: why are so different the response headers as reported by wget and httpclient?

Posted by "Stephen J. Butler" <st...@gmail.com>.
On Tue, May 7, 2013 at 3:36 AM, Albretch Mueller <lb...@gmail.com> wrote:

> > It's passing the wrong 'Host' line. That's why you are getting a 404.
>
>  well, the code section in which I set the host I pasted bellow (
> notice how I set the Host as part of the Request Headers  {"Host",
> (httpGet.getURI()).getHost()} ):


Yes, but that's not correct after the redirect. First time it connects the
'Host' line should be 'download.ted.com'. But the second time, after
following the redirect, it needs to be 'video.ted.com'.


> > Are you using standard code to handle the redirect, or writing your own?
>
>  I will have to do the redirect myself and I would like to handle/get
> all the response headers of every redirect. How do you do that? Could
> you point me to some basic redirect code example?
>
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
>   HttpGet httpGet = new HttpGet(aGetURL);
>   String aRqLn = httpGet.getRequestLine().toString();   // Request Line
> System.err.println("// __ httpGet.getRequestLine(): |" + aRqLn + "|");
>
> ...
> // __ parsing host from URL
>   String aHost = (httpGet.getURI()).getHost();
> System.err.println("// __ aHost: |" + aHost + "|");
>
>   String[][] aRqHdrs = new String[][]{
>      {"Host", aHost}
>    , {"Connection", "keep-alive"}
>    , {"User-Agent", "Mozilla/5.0 (X11; Linux i686; rv:10.0.4)
> Gecko/20100101 Firefox/10.0.4 Iceweasel/10.0.4"}
>    , {"Accept", "text/html, text/*;q=0.9, image/jpeg;q=0.9,
> image/png;q=0.9, image/*;q=0.9, */*;q=0.8"}
>    , {"Accept-Encoding", "gzip, deflate, x-gzip, x-deflate"}
>    , {"Accept-Charset", "utf-8,*;q=0.5"}
>    , {"Accept-Language", "en-US,en;q=0.9"}
>   };
>

I see, you're setting the request header manually! That's why HttpClient is
failing to properly set the Host header.

I'd suggest you not set the Host header manually and let HttpClient do it.
It will add it itself; that's mandated by the HTTP 1.1 spec.

If you insist on handling the redirect manually, set
the ClientPNames.HANDLE_REDIRECTS parameter to Boolean.FALSE. Then the
return from executing your request will be the raw redirect, and you'll
have to catch that case and resubmit the request on the proper URL.

Re: why are so different the response headers as reported by wget and httpclient?

Posted by Albretch Mueller <lb...@gmail.com>.
> It's passing the wrong 'Host' line. That's why you are getting a 404.

 well, the code section in which I set the host I pasted bellow (
notice how I set the Host as part of the Request Headers  {"Host",
(httpGet.getURI()).getHost()} ):

> Are you using standard code to handle the redirect, or writing your own?

 I will have to do the redirect myself and I would like to handle/get
all the response headers of every redirect. How do you do that? Could
you point me to some basic redirect code example?

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
  HttpGet httpGet = new HttpGet(aGetURL);
  String aRqLn = httpGet.getRequestLine().toString();   // Request Line
System.err.println("// __ httpGet.getRequestLine(): |" + aRqLn + "|");

...
// __ parsing host from URL
  String aHost = (httpGet.getURI()).getHost();
System.err.println("// __ aHost: |" + aHost + "|");

  String[][] aRqHdrs = new String[][]{
     {"Host", aHost}
   , {"Connection", "keep-alive"}
   , {"User-Agent", "Mozilla/5.0 (X11; Linux i686; rv:10.0.4)
Gecko/20100101 Firefox/10.0.4 Iceweasel/10.0.4"}
   , {"Accept", "text/html, text/*;q=0.9, image/jpeg;q=0.9,
image/png;q=0.9, image/*;q=0.9, */*;q=0.8"}
   , {"Accept-Encoding", "gzip, deflate, x-gzip, x-deflate"}
   , {"Accept-Charset", "utf-8,*;q=0.5"}
   , {"Accept-Language", "en-US,en;q=0.9"}
  };
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
 lbrtchx

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: why are so different the response headers as reported by wget and httpclient?

Posted by "Stephen J. Butler" <st...@gmail.com>.
This is suspicious:

On Mon, May 6, 2013 at 11:38 PM, Albretch Mueller <lb...@gmail.com>wrote:

> Connecting to video.ted.com:80
>

[snip]

2013/05/07 00:31:06:613 GMT [DEBUG] headers - >> GET
> /talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4 HTTP/1.1
> 2013/05/07 00:31:06:614 GMT [DEBUG] headers - >> Host: download.ted.com


It's passing the wrong 'Host' line. That's why you are getting a 404. Are
you using standard code to handle the redirect, or writing your own?

Re: why are so different the response headers as reported by wget and httpclient?

Posted by Albretch Mueller <lb...@gmail.com>.
 a full wire log shows:

$ java -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
-Dorg.apache.commons.logging.simplelog.showdatetime=true
-Dorg.apache.commons.logging.simplelog.log.org.apache.http=DEBUG
-Dorg.apache.commons.logging.simplelog.log.org.apache.http.wire=ERROR
HC_DownMetaHTTPHeaders02Test

...

// __ |http://download.ted.com/talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD|
// __ httpGet.getRequestLine(): |GET
http://download.ted.com/talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD
HTTP/1.1|

// ___ after (new
HttpGet(http://download.ted.com/talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD)):
|00 hours, 00 mins, 00 seconds 000 (ms)|
// __ aHost: |download.ted.com|
// __ aRqLn: |GET
http://download.ted.com/talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD
HTTP/1.1|
// __ RqstHdrs.length: |7|[Lorg.apache.http.Header;@ca8d94|

2013/05/07 00:31:06:169 GMT [DEBUG] BasicClientConnectionManager - Get
connection for route {}->http://download.ted.com
2013/05/07 00:31:06:172 GMT [DEBUG] DefaultClientConnectionOperator -
Connecting to download.ted.com:80
2013/05/07 00:31:06:193 GMT [DEBUG] RequestAddCookies - CookieSpec
selected: best-match
2013/05/07 00:31:06:193 GMT [DEBUG] RequestAddCookies - Cookie
[version: 0][name: symfony][value: 1cqnumd1nhgttffc2lkb08u8t2][domain:
.ted.com][path: /][expiry: null] match
[download.ted.com:80/talks/LuisVonAhn_2011X-480p.mp4]
2013/05/07 00:31:06:193 GMT [DEBUG] RequestAuthCache - Auth cache not
set in the context
2013/05/07 00:31:06:207 GMT [DEBUG] RequestTargetAuthentication -
Target auth state: UNCHALLENGED
2013/05/07 00:31:06:207 GMT [DEBUG] RequestProxyAuthentication - Proxy
auth state: UNCHALLENGED
2013/05/07 00:31:06:207 GMT [DEBUG] DefaultHttpClient - Attempt 1 to
execute request
2013/05/07 00:31:06:208 GMT [DEBUG] DefaultClientConnection - Sending
request: GET /talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD
HTTP/1.1
2013/05/07 00:31:06:208 GMT [DEBUG] headers - >> GET
/talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD HTTP/1.1
2013/05/07 00:31:06:209 GMT [DEBUG] headers - >> Host: download.ted.com
2013/05/07 00:31:06:209 GMT [DEBUG] headers - >> Connection: keep-alive
2013/05/07 00:31:06:210 GMT [DEBUG] headers - >> User-Agent:
Mozilla/5.0 (X11; Linux i686; rv:10.0.4) Gecko/20100101 Firefox/10.0.4
Iceweasel/10.0.4
2013/05/07 00:31:06:210 GMT [DEBUG] headers - >> Accept: text/html,
text/*;q=0.9, image/jpeg;q=0.9, image/png;q=0.9, image/*;q=0.9,
*/*;q=0.8
2013/05/07 00:31:06:210 GMT [DEBUG] headers - >> Accept-Encoding:
gzip, deflate, x-gzip, x-deflate
2013/05/07 00:31:06:213 GMT [DEBUG] headers - >> Accept-Charset: utf-8,*;q=0.5
2013/05/07 00:31:06:213 GMT [DEBUG] headers - >> Accept-Language: en-US,en;q=0.9
2013/05/07 00:31:06:213 GMT [DEBUG] headers - >> Cookie:
symfony=1cqnumd1nhgttffc2lkb08u8t2
2013/05/07 00:31:06:213 GMT [DEBUG] headers - >> Cookie2: $Version=1
2013/05/07 00:31:06:595 GMT [DEBUG] DefaultClientConnection -
Receiving response: HTTP/1.1 302 Moved Temporarily
2013/05/07 00:31:06:595 GMT [DEBUG] headers - << HTTP/1.1 302 Moved Temporarily
2013/05/07 00:31:06:596 GMT [DEBUG] headers - << Server: nginx
2013/05/07 00:31:06:596 GMT [DEBUG] headers - << Date: Tue, 07 May
2013 04:31:21 GMT
2013/05/07 00:31:06:596 GMT [DEBUG] headers - << Content-Type: text/html
2013/05/07 00:31:06:596 GMT [DEBUG] headers - << Transfer-Encoding: chunked
2013/05/07 00:31:06:596 GMT [DEBUG] headers - << Connection: keep-alive
2013/05/07 00:31:06:596 GMT [DEBUG] headers - << X-Cache: MISS
2013/05/07 00:31:06:596 GMT [DEBUG] headers - << Location:
http://video.ted.com/talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4
2013/05/07 00:31:06:596 GMT [DEBUG] DefaultHttpClient - Connection can
be kept alive indefinitely
2013/05/07 00:31:06:596 GMT [DEBUG] DefaultRedirectStrategy - Redirect
requested to location
'http://video.ted.com/talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4'
2013/05/07 00:31:06:596 GMT [DEBUG] DefaultHttpClient - Resetting
target auth state
2013/05/07 00:31:06:596 GMT [DEBUG] DefaultHttpClient - Redirecting to
'http://video.ted.com/talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4'
via {}->http://video.ted.com
2013/05/07 00:31:06:596 GMT [DEBUG] BasicClientConnectionManager -
Releasing connection
org.apache.http.impl.conn.ManagedClientConnectionImpl@15005d
2013/05/07 00:31:06:596 GMT [DEBUG] BasicClientConnectionManager -
Connection can be kept alive indefinitely
2013/05/07 00:31:06:597 GMT [DEBUG] BasicClientConnectionManager - Get
connection for route {}->http://video.ted.com
2013/05/07 00:31:06:597 GMT [DEBUG] DefaultClientConnection -
Connection 0.0.0.0:43290<->54.242.198.180:80 closed
2013/05/07 00:31:06:597 GMT [DEBUG] DefaultClientConnectionOperator -
Connecting to video.ted.com:80
2013/05/07 00:31:06:612 GMT [DEBUG] RequestAddCookies - CookieSpec
selected: best-match
2013/05/07 00:31:06:612 GMT [DEBUG] RequestAddCookies - Cookie
[version: 0][name: symfony][value: 1cqnumd1nhgttffc2lkb08u8t2][domain:
.ted.com][path: /][expiry: null] match
[video.ted.com:80/talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4]
2013/05/07 00:31:06:612 GMT [DEBUG] RequestAuthCache - Auth cache not
set in the context
2013/05/07 00:31:06:613 GMT [DEBUG] RequestTargetAuthentication -
Target auth state: UNCHALLENGED
2013/05/07 00:31:06:613 GMT [DEBUG] RequestProxyAuthentication - Proxy
auth state: UNCHALLENGED
2013/05/07 00:31:06:613 GMT [DEBUG] DefaultHttpClient - Attempt 2 to
execute request
2013/05/07 00:31:06:613 GMT [DEBUG] DefaultClientConnection - Sending
request: GET /talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4
HTTP/1.1
2013/05/07 00:31:06:613 GMT [DEBUG] headers - >> GET
/talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4 HTTP/1.1
2013/05/07 00:31:06:614 GMT [DEBUG] headers - >> Host: download.ted.com
2013/05/07 00:31:06:614 GMT [DEBUG] headers - >> Connection: keep-alive
2013/05/07 00:31:06:614 GMT [DEBUG] headers - >> User-Agent:
Mozilla/5.0 (X11; Linux i686; rv:10.0.4) Gecko/20100101 Firefox/10.0.4
Iceweasel/10.0.4
2013/05/07 00:31:06:614 GMT [DEBUG] headers - >> Accept: text/html,
text/*;q=0.9, image/jpeg;q=0.9, image/png;q=0.9, image/*;q=0.9,
*/*;q=0.8
2013/05/07 00:31:06:614 GMT [DEBUG] headers - >> Accept-Encoding:
gzip, deflate, x-gzip, x-deflate
2013/05/07 00:31:06:615 GMT [DEBUG] headers - >> Accept-Charset: utf-8,*;q=0.5
2013/05/07 00:31:06:615 GMT [DEBUG] headers - >> Accept-Language: en-US,en;q=0.9
2013/05/07 00:31:06:615 GMT [DEBUG] headers - >> Cookie:
symfony=1cqnumd1nhgttffc2lkb08u8t2
2013/05/07 00:31:06:615 GMT [DEBUG] headers - >> Cookie2: $Version=1
2013/05/07 00:31:06:629 GMT [DEBUG] DefaultClientConnection -
Receiving response: HTTP/1.1 404 Not Found
2013/05/07 00:31:06:632 GMT [DEBUG] headers - << HTTP/1.1 404 Not Found
2013/05/07 00:31:06:632 GMT [DEBUG] headers - << Server: Footprint 4.8/FPMCP
2013/05/07 00:31:06:632 GMT [DEBUG] headers - << Mime-Version: 1.0
2013/05/07 00:31:06:633 GMT [DEBUG] headers - << Date: Tue, 07 May
2013 04:31:21 GMT
2013/05/07 00:31:06:633 GMT [DEBUG] headers - << Content-Type: text/html
2013/05/07 00:31:06:633 GMT [DEBUG] headers - << Content-Length: 632
2013/05/07 00:31:06:633 GMT [DEBUG] headers - << Expires: Tue, 07 May
2013 04:31:21 GMT
2013/05/07 00:31:06:633 GMT [DEBUG] headers - << Connection: close

// __ httpResponse.getStatusLine().toString(): |HTTP/1.1 404 Not Found|

2013/05/07 00:31:06:634 GMT [DEBUG] BasicClientConnectionManager -
Releasing connection
org.apache.http.impl.conn.ManagedClientConnectionImpl@cb03c4
2013/05/07 00:31:06:634 GMT [DEBUG] DefaultClientConnection -
Connection 0.0.0.0:52042<->4.27.18.254:80 shut down

// __ request line: |GET
http://download.ted.com/talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD
HTTP/1.1|

// __  7 response headers received from server:
// __ Server: Footprint 4.8/FPMCP
// __ Mime-Version: 1.0
// __ Date: Tue, 07 May 2013 04:31:21 GMT
// __ Content-Type: text/html
// __ Content-Length: 632
// __ Expires: Tue, 07 May 2013 04:31:21 GMT
// __ Connection: close

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: why are so different the response headers as reported by wget and httpclient?

Posted by "Stephen J. Butler" <st...@gmail.com>.
What does a full wire log show?

http://hc.apache.org/httpcomponents-client-ga/logging.html


On Mon, May 6, 2013 at 10:03 PM, Albretch Mueller <lb...@gmail.com> wrote:

> ~
>  and what do you have to do get the same or a similar response in
> order to strategize around the "HTTP/1.1 302 Moved Temporarily" using
> httpclient?
> ~
>  thanks,
>  lbrtchx
> ~
> // __ wget
>
> $ wget --server-response --spider
> "
> http://download.ted.com/talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD
> "
> Spider mode enabled. Check if remote file exists.
> --2013-05-06 22:51:07--
> http://download.ted.com/talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD
> Resolving download.ted.com (download.ted.com)... 54.242.198.180
> Connecting to download.ted.com
> (download.ted.com)|54.242.198.180|:80... connected.
> HTTP request sent, awaiting response...
>   HTTP/1.1 302 Moved Temporarily
>   Server: nginx
>   Date: Tue, 07 May 2013 02:51:22 GMT
>   Content-Type: text/html
>   Connection: keep-alive
>   X-Cache: HIT
>   Location:
> http://video.ted.com/talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4
> Location:
> http://video.ted.com/talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4
> [following]
> Spider mode enabled. Check if remote file exists.
> --2013-05-06 22:51:08--
> http://video.ted.com/talk/podcast/2011X/None/LuisVonAhn_2011X-480p.mp4
> Resolving video.ted.com (video.ted.com)... 4.27.18.254, 8.254.54.254
> Connecting to video.ted.com (video.ted.com)|4.27.18.254|:80... connected.
> HTTP request sent, awaiting response...
>   HTTP/1.1 200 OK
>   Cache-Control: public, max-age=31536000
>   Date: Tue, 07 May 2013 02:51:22 GMT
>   Content-Length: 116040512
>   Content-Type: video/mp4
>   ETag: "72d080c60cb8fdd4add7187d3ffedcd3"
>   Expires: Sun, 27 Apr 2014 13:47:31 GMT
>   Last-Modified: Sat, 11 Aug 2012 01:47:29 GMT
>   Accept-Ranges: bytes
>   Server: AmazonS3
>   x-amz-id-2:
> g2uS6EA5QCq8d0uwrem9QQueXR+L8lHNj85ePL1WD8Ju6iV94J3QuRGsCdqPgTMN
>   x-amz-request-id: F83B24FCD7D43060
>   Connection: keep-alive
> Length: 116040512 (111M) [video/mp4]
> Remote file exists.
> ~
> // __ httpclient
>
> // __ |
> http://download.ted.com/talks/LuisVonAhn_2011X-480p.mp4?apikey=TEDDOWNLOAD|
> // __ httpResponse.getStatusLine().toString(): |HTTP/1.1 404 Not Found|
> // __  7 response headers received from server:
> // __ Server: Footprint 4.8/FPMCP
> // __ Mime-Version: 1.0
> // __ Date: Tue, 07 May 2013 02:44:01 GMT
> // __ Content-Type: text/html
> // __ Content-Length: 633
> // __ Expires: Tue, 07 May 2013 02:44:01 GMT
> // __ Connection: close
> ~
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>