[OTDev] Java Clients - Any suggestions?

Nina Jeliazkova nina at acad.bg
Thu Oct 1 19:44:20 CEST 2009


Hi Pantelis,

You could simply use java.net.HttpURLConnection :

            HttpURLConnection conn = (HttpURLConnection)
    url.openConnection();
            conn.setRequestMethod("GET");
            conn.setUseCaches(false);
            conn.setRequestProperty("Accept","chemical/x-daylight-smiles");


Here is the code from our demo client earlier this year:  
https://ambit.svn.sourceforge.net/svnroot/ambit/branches/ambit-rest-client/src/main/java/ambit2/client/rest/Query.java


For more complex applications, Restlet is much more convenient.   Sun's
Jersey is another Java REST library https://*jersey*.dev.java.net . 
Have no experience wit Apache HttpClient.

Best regards,
Nina

chung wrote:
> Dear All,
>  Does anyone have some experience with clients written in Java. I want
> to perform a GET request specifying the header "Accept:text/xml". Can I
> do that using the HttpClient class
> ( http://hc.apache.org/httpclient-3.x/ ) or maybe restlet? Which Java
> library do you think would be a good choice? 
>
> Thank you in advance,
> Pantelis
>
> _______________________________________________
> Development mailing list
> Development at opentox.org
> http://www.opentox.org/mailman/listinfo/development
>   




More information about the Development mailing list