This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Services and the fly likes Jersey POST client gives 405 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Jersey POST client gives 405" Watch "Jersey POST client gives 405" New topic
Author

Jersey POST client gives 405

Kishor Samant
Greenhorn

Joined: Apr 11, 2012
Posts: 3
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
 
wood burning stoves
 
subject: Jersey POST client gives 405
 
Similar Threads
Jersey RESTful web service - How to post XML file using jersey framework
JAXB Based JSON support not working with Jersey JAX-RS
Problem in DELETE operation in REST Webservice
Sending and Retrieving JSON data from Jersey API
How to Write a Java Client to consume REST webservice using POST method