hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ossf...@dubioso.net>
Subject Re: beginner doubt
Date Sat, 01 Mar 2008 05:37:08 GMT
Hello Valentin,

> Everything seems to be OK but the only result I get is:
> 
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">-->
> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
>         <head>
>                 <script type="text/javascript">
>                         function setRedirectionValue () {
>                                 var redirect = document.location;
>                                 if (redirect == "") {
>                                         redirect = "/";
>                                 }
>                                 document.forms.restoreSession.Name.value =
> "";
>                                 document.forms.restoreSession.Value.value =
> "";
> 
> document.forms.restoreSession.Redirect.value = "";
> 
> document.forms.restoreSession.Language.value = "";
> 
> document.forms.restoreSession.RedirectError.value = "";
> 
> document.forms.restoreSession.forwardValue.value = redirect;
>                                 document.forms.restoreSession.submit();
>                         }
>                 </script>
>         </head>
>         <body>
>                 <form id="restoreSession" action="/RestoreSession"
> method="post">
>             <input name="Name" type ="hidden" value="" />
>             <input name="Value" type ="hidden" value="" />
>             <input name="Redirect" type ="hidden" value="" />
>             <input name="Language" type ="hidden" value="" />
>             <input name="RedirectError" type ="hidden" value="" />
>             <input name="forwardValue" type="hidden"  value="" />
>                 </form>
>                 <script
> type="text/javascript">setRedirectionValue();</script>
>         </body>
> </html>
> 
> However, when I use a browser and use the "view/source code" command the
> result is completely different, I get the real data.


HttpClient is not a browser. It certainly doesn't interpret JavaScript:
http://wiki.apache.org/HttpComponents/ForAbsoluteBeginners#head-e5df784207b3082d88f0c254a0b656275c2b2855


> Any Idea about how to get the same result using httpclient or any other
> library?

Figure out what POST request is generated by the JavaScript code and
send that after your initial GET. The primer linked above might help.

cheers,
   Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message