There are different ways how to make a request in Java. Considering Restlet framework:
// Prepare the data for the request
String tp = "http://nb.vse.cz/~svabo/patomat/tp/tp_hasSome2.xml";
String ontology = "http://nb.vse.cz/~svabo/oaei2009/data/cmt.owl";
Representation entity = new StringRepresentation("tp="+tp+"&ontology+"ontology",
MediaType.TEXT_XML);
// Prepare the request
ClientResource resource = new
ClientResource("http://owl.vse.cz:8080/ontologyTransformation/detection");
// Send the HTTP POST request
resource.post(entity);
//Do what you want with a response, e.g.:
resource.getResponseEntity().write(System.out);
Considering Java standard library, an HTTP client, the code snippet would be as follows:
// Prepare the data for the request
NameValuePair[] data = {
new NameValuePair("tp", "http://nb.vse.cz/~svabo/patomat/tp/tp_hasSome2.xml"),
new NameValuePair("ontology", "http://nb.vse.cz/~svabo/oaei2009/data/cmt.owl")
};
// Prepare the request
HttpClient client = new HttpClient();
PostMethod post = new
PostMethod("http://owl.vse.cz:8080/ontologyTransformation/detection");
post.setRequestBody(data);
// Execute the method.
int statusCode = client.executeMethod(post);
//Do what you want with a response, e.g.:
InputStream in = post.getResponseBodyAsStream();