webrequest - HttpWebRequest simulating the request from firebug always failed -


i got eccentric problem. trying automate visiting web site using webrequest , webclient. have observed post request header key-value pairs , posted data string in firebug(request header , post tab). simulated such request webrequest , put header parameter , posted data there. when getresponse() request instance, got error page says sessionid short of.

actually have taken care put previously(first step open logon page) responded session cookie in header's cookie field request. , can correct response simulating requesting logon page(the 1st page), cannot through authentication page. post data userid=john&password=123456789&domain=highmark.and authentication page request carried out browser succeeds every time.

am missing in request may not shown firebug.if yes, can give me recommendation tools may examine entire request sent browser.

i have solved issue. problem set httpwebrequest instance's allowautoredirect=true. effect when got first response server, httpwebrequest continually make request asking different url replied in response header's location field.

the defect of httpwebrequest class when getting redirected, not include set-cookies(response's header field)'s cookies in next request header, server deny such page request , may redirect again different page.

and httpwebrequest.getresponse() method return last responsed page under setting allowautoredirect=true. , got totally different response expected.

also in solving process, need thank distinguish http traffic examining tool:ieinspector http analyzer(http://www.ieinspector.com/httpanalyzer/). great feature of tool can examine not http traffic browser what process's httpwebrequest made. , can display in text format raw stream of request , response. although commercial software, can try 15 days. quite happy tells me(in well-formed details) , buy well.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -