Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[bioontology-support] ontology link

Michael Dorf mdorf at
Tue Dec 1 16:25:53 PST 2015

Hi Yuli,

You are making a POST call to a service endpoint that requires a GET. This endpoint does not accept POST calls. See docs here:


On Dec 1, 2015, at 12:34, Li, Yuli < at< at>> wrote:


I would like to get JSON data from the link below by using java

why java returned ‘<h1>Not Found</h1>’

see code below:

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.params.HttpMethodParams;
public class Client {

public static final String  url = "";

    public static void main( String[] args ) {
        try {
            HttpClient client = new HttpClient();
            HttpMethodParams.USER_AGENT," Client Example ");  //Set this string for your application

            PostMethod method = new PostMethod(url);
            method.addParameter("apikey", “my code 1c8a69b3...”)            // Execute the POST method
            int statusCode = client.executeMethod(method);

            if( statusCode != -1 ) {
                try {
                String contents = method.getResponseBodyAsString();
                catch( Exception e ) {
        catch( Exception e ){


Why always get “Not Found”,

Could you please let me know how to get content by java?



bioontology-support mailing list
bioontology-support at<mailto:bioontology-support at>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the bioontology-support mailing list