Hi,
I’m also wondering about the “connection: close” header in the response when connecting to stream.twitter.com.
Shouldn’t this be keep-alive?
Using Apache httpclient 4.5.2, the request goes like this:
“http-outgoing-0 >> “POST /1.1/statuses/filter.json HTTP/1.1[\r][\n]””
“http-outgoing-0 >> “Authorization: OAuth oauth_consumer_key=”…”, oauth_nonce="…", oauth_signature="…", oauth_signature_method=“HMAC-SHA1”, oauth_timestamp=“1477402380”, oauth_token="…", oauth_version=“1.0”[\r][\n]""
“http-outgoing-0 >> “Content-Length: 31[\r][\n]””
“http-outgoing-0 >> “Content-Type: application/x-www-form-urlencoded; charset=UTF-8[\r][\n]””
“http-outgoing-0 >> “Host: stream.twitter.com[\r][\n]””
“http-outgoing-0 >> “Connection: Keep-Alive[\r][\n]””
“http-outgoing-0 >> “[\r][\n]””
“http-outgoing-0 >> “track=trump&stall_warnings=true””
And in the response, I get:
“http-outgoing-0 << “HTTP/1.1 200 OK[\r][\n]””
“http-outgoing-0 << “connection: close[\r][\n]””
“http-outgoing-0 << “content-type: application/json[\r][\n]””
“http-outgoing-0 << “date: Tue, 25 Oct 2016 13:33:02 GMT[\r][\n]””
“http-outgoing-0 << “server: tsa[\r][\n]””
“http-outgoing-0 << “transfer-encoding: chunked[\r][\n]””
“http-outgoing-0 << “x-connection-hash: a9aab11f353f7410a61066ae9b4d0b82[\r][\n]””
“http-outgoing-0 << “[\r][\n]””
If I try to do the same using https://dev.twitter.com/rest/tools/console
the response is:
HTTP/1.1 200 OK
x-connection-hash: 981b94c1fb752a65e152faff3aeedb77
Date: Tue, 25 Oct 2016 13:41:00 GMT
Content-Length: 0
Connection: keep-alive
Content-Type: application/json
Server: tsa
So, why am I getting “connection: close” header?