File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Web Services
Bookmark "Jersey POST client gives 405" Watch "Jersey POST client gives 405" New topic

Jersey POST client gives 405

Kishor Samant

Joined: Apr 11, 2012
Posts: 3

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.

* @param startTime
* @param endTime
* @return is success
public String downloadByTime(@PathParam("startTime") String startTime,@PathParam("endTime") String endTime){

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,
I agree. Here's the link:
subject: Jersey POST client gives 405
It's not a secret anymore!