• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jersey POST client gives 405

 
Kishor Samant
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was writing a post method with two string path param in it. While running jersey client i got 405 but when tried hitting the URL directly from browser it executed properly. Adding code below.

Service,
@GET
@Path("/DownloadByTime/{startTime}&{endTime}")
@Produces(MediaType.TEXT_PLAIN)
/**
* @param startTime
* @param endTime
* @return is success
*/
public String downloadByTime(@PathParam("startTime") String startTime,@PathParam("endTime") String endTime){
}


Client,
String url ="http://localhost:8080/....../DownloadByTime/
DefaultClientConfig config = new DefaultClientConfig();
Client client = Client.create(config);
WebResource resource = client.resource(url);
ClientResponse response = resource.path(startTime+"&"+endTime).post(ClientResponse.class);


The URL I hit from browser,
http://localhost:8080/......./DownloadByTime/2013-10-11T08:32:55+00:00&2013-10-11T20:32:55+00:00
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic