On Tue, 2007-11-13 at 16:14 +0800, Richard G. Reyes wrote:
> Hi All,
>
> I am trying to automate a configuration of a device via httpclient. The
> device have a web interface and I can configure it via browser without a
> problem. But when I try to configure it via httpclient my application
> just hangs here...
>
> > 2007/11/13 15:52:24:984 CST [DEBUG] HttpConnection - Open connection to 192.168.15.18:80
> > 2007/11/13 15:52:25:000 CST [DEBUG] header - >> "POST /dologin.htm HTTP/1.1[\r][\n]"
> > 2007/11/13 15:52:25:000 CST [DEBUG] HttpMethodBase - Adding Host request header
> > 2007/11/13 15:52:25:000 CST [DEBUG] HttpMethodBase - Default charset used: ISO-8859-1
> > 2007/11/13 15:52:25:015 CST [DEBUG] HttpMethodBase - Default charset used: ISO-8859-1
> > 2007/11/13 15:52:25:015 CST [DEBUG] header - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
> > 2007/11/13 15:52:25:015 CST [DEBUG] header - >> "Host: 192.168.15.18[\r][\n]"
> > 2007/11/13 15:52:25:015 CST [DEBUG] header - >> "Content-Length: 31[\r][\n]"
> > 2007/11/13 15:52:25:015 CST [DEBUG] header - >> "Content-Type: application/x-www-form-urlencoded[\r][\n]"
> > 2007/11/13 15:52:25:015 CST [DEBUG] header - >> "[\r][\n]"
> > 2007/11/13 15:52:25:015 CST [DEBUG] content - >> "P2=admin&gnkey=0b82&Login=Login"
> > 2007/11/13 15:52:25:015 CST [DEBUG] EntityEnclosingMethod - Request body sent
>
> This above is the last line and stops there. I have captured the the
> post and heres what I got. Theres a huge difference between the post the
> browser sent from the one sent by the httpclient. But I am not certain
> that the problem lies in here.
>
> Heres the browser post packet...
> > POST /dologin.htm HTTP/1.1
> > Host: 192.168.15.18
> > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025
Firefox/2.0.0.9
> > Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
> > Accept-Language: en-us,en;q=0.5
> > Accept-Encoding: gzip,deflate
> > Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
> > Keep-Alive: 300
> > Connection: keep-alive
> > Referer: http://192.168.15.18/index.htm
> > Content-Type: application/x-www-form-urlencoded
> > Content-Length: 29
> >
>
> Heres the application post packet...
> > POST /dologin.htm HTTP/1.1
> > User-Agent: Jakarta Commons-HttpClient/3.1
> > Host: 192.168.15.18
> > Content-Length: 31
> > Content-Type: application/x-www-form-urlencoded
> >
>
> I hope someone could point me to the right direction in solving this
> problem
Richard,
For a start try masquerading HttpClient as a Mozilla/5.0 compatible
browser.
Oleg
> .
>
> Thanks in advance.
> Richard
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
|