I am writing a java program that is sending a HTTP 1.1 request and getting a response from a web server. The request that I am sending is identical to the one in the browser, IE8. I am using ieHTTPheaders to see what the headers are for the request. I am mimicking this request exactly in java(except for the cookie and the time stamp which is the number after "turnCacheOff="), but in my response headers I get in java specifically the header Transfer-Encoding: chunked is different than the header Content-Length: 1327 that I get in the browser. Why does this happen when the requests are exactly the same? Here is the browser request headers:
GET /WFLogon?inv=cl457239&turnCacheOff=1285437824858 HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://service.atty-pierce.com/ Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6; Comcast Install 1.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.2; .NET CLR 3.5.30729)
Accept-Encoding: gzip, deflate
Is this consistent behavior? That is, if you run the same request multiple times in IE, do you always get a specified transfer length? And if you run it multiple times through Java, do you always get a chunked response?
The reason I ask is that choosing whether to send as a chunked response is usually something that is up to the server - it can choose whether to wait until it has all the data, or it can start sending data back before the entire message has been marshaled.
Also - what is the size of the total response you get through Java? Is it the same size as the response the IE request generates? Or is it greater than the size of the Write Buffer Size defined in the WebSphere server you are connecting to?
I'm new to posting and wasn't aware the cross posting could be an issue. Sorry about that, I will make sure I make that I include that information next time. As for the responses they are consistent in both the browser and in the java program. The body content is identical after comparing the two. So I guess practically speaking that the java application is working properly, but I don't understand how could the server choose do chunk on the java application and not chunk in IE8 when the requests are identical. There must be something that is creating that effect. Can it have to do with how the underlying protocols are being dealt with in java? Like TCP or IP?
This tiny ad is suggesting that maybe she should go play in traffic.