HTTP Problems

I am writing an automated HTTP client for a Web. App. running on Web Logic. The app server is returning a session error when I attempt to redirect after login. I have noticed that the HTTP header is picking up redundant entries. I have replaced any security related information with '^'.

Notice the Accept-Encoding:

headers = { "Accept" : "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*",
"Referer" : "http://^^^.^^^.^^^.^^^:^^^/^^^",
"Accept-Language" : "en-us",
"Accept-Encoding" : "gzip, deflate",
"User-Agent" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)",
"Host" : "^^^.^^^.^^^.^^^:^^^",
"Connection" : "Keep-Alive",
"Cache-Control" : "no-cache",
"Cookie" : "JSESSIONID=" + jSessionID }
***** The http:// before "httplib" is being added by the message board
conn = httplib.HTTPConnection("^^^.^^^.^^^.^^^:^^^")
conn.request("GET", "/^^/LoadMyTaskList1.do?ContextAction=Initialize", "", headers)
response2 = conn.getresponse()
print response2.status, response2.reason
data = response2.read()
print data
conn.close()

HTTP Snoop:

***** The http:// before "HTTP/1.1" is being added by the message board

GET /^^^/LoadMyTaskList1.do?ContextAction=Initialize HTTP/1.1
Accept-Encoding: identity
Host: "^^^.^^^.^^^.^^^:^^^"
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Cache-Control: no-cache
Referer: http://^^^.^^^.^^^.^^^:^^^/^^^
Cookie: JSESSIONID=^^^^^^^^^^^^^^^^^^^^^^^^^^^
Connection: Keep-Alive
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)

I am not an HTTP programmer so any critique is also apreshiated.

Thanks,
Bruce
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories