I try to send http request and get the result with a Java code
this is the Server side:
public class Testws {
@GET
@Path("/test/{id}")
@Produces("application/xml")
public Integer getAssets(@PathParam("id") int id){
}
}
And this is the Client side:
URL url = new URL("http://xxx/route/test/1");
HttpsURLConnection connection = (HttpsURLConnection)url.openConnection();
connection.setDoOutput(true);
connection.connect();
final int responseCode = connection.getResponseCode();
when i run this java code i got an 405 status code but when i put the link (http://xxx/route/test/1) directly in the browser it works fine i got 200 as a response code. How can i fix this ?