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
Host: service.atty-pierce.com
Proxy-Connection: Keep-Alive
Browser Response Headers:
HTTP/1.1 200 OK
Server: WebSphere Application Server/5.0
Set-Cookie: JSESSIONID=0000aZd4utW600Wzgi11Rg8qywu:-1;Path=/
Cache-Control: no-cache="set-cookie,set-cookie2"
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Content-Type: text/html; charset=UTF-8
Content-Language: en-US
Content-Length: 1327
In my java program the request headers are identical the that of the browser but the response comes back as:
HTTP/1.1 200 OK
Server: WebSphere Application Server/5.0
Set-Cookie: JSESSIONID=0000__qTreRMAs-768fpanccifr:-1;Path=/
Cache-Control: no-cache="set-cookie,set-cookie2"
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Content-Type: text/html; charset=UTF-8
Content-Language: en-US
Transfer-Encoding: chunked
Here is the code that I am using to make the request:
Expand|Select|Wrap|Line Numbers
- Calendar calendar = Calendar.getInstance();
- java.util.Date now = calendar.getTime();
- java.sql.Timestamp currentTimestamp = new java.sql.Timestamp(now.getTime());
- System.out.println(currentTimestamp.getTime());
- InputStream is2=null;
- OutputStream os2=null;
- String request="";
- try {
- Socket pierce2 = new Socket("service.atty-pierce.com", 80);
- os2=pierce2.getOutputStream();
- is2=pierce2.getInputStream();
- request+="GET /WFLogon?inv=cl457239&turnCacheOff=" + Long.toString(currentTimestamp.getTime()) + " HTTP/1.1\r\n";
- request+="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, */*\r\n";
- request+="Referer: http://service.atty-pierce.com/\r\n";
- request+="Accept-Language: en-us\r\n";
- request+="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)\r\n";
- request+="Accept-Encoding: gzip, deflate\r\n";
- request+="Host: service.atty-pierce.com\r\n";
- request+="Proxy-Connection: Keep-Alive\r\n\r\n";
- System.out.print(request);
- os2.write(request.getBytes());
- int c;
- do
- {
- char x;
- c=is2.read();
- x=(char)c;
- if (c!=-1) System.out.print(x);
- } while (c!=-1);
- } catch (Exception ex) {
- Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
- }