[Dev] [Jaggery] Error while calling jaggery post method

2014-08-24 Thread Rajkumar Rajaratnam
Hi, I am calling post method from a jaggery app. var response = post(endpoint,data,headers, 'json'); This is calling the following REST API. @POST @Path(/policy/deployment/partition) @Produces(application/json) @Consumes(application/json) @AuthorizationAction(

Re: [Dev] [Jaggery] Error while calling jaggery post method

2014-08-24 Thread Rajith Vitharana
Hi Rajkumar, I have tried out your scenario. AFAIU this happens when your rest response is empty. Empty response throws this exception. You can see that your response is empty or not by changing the rest end point and print or logging the final response which is sent back to the jaggery

Re: [Dev] [Jaggery] Error while calling jaggery post method

2014-08-24 Thread Dakshika Jayathilaka
Hi, try with this.. var response = post(endpoint,data,headers, 'text'); *Dakshika Jayathilaka* Software Engineer WSO2, Inc. lean.enterprise.middleware 0771100911 On Sun, Aug 24, 2014 at 4:22 PM, Rajkumar Rajaratnam rajkum...@wso2.com wrote: Hi Rajith, I have already verified that the

Re: [Dev] [Jaggery] Error while calling jaggery post method

2014-08-24 Thread Udara Liyanage
Hi Raj, According to the code, response is not empty, but is response body. Newly created resource url is received as location header. Touched, not typed. Erroneous words are a feature, not a typo. ___ Dev mailing list Dev@wso2.org

Re: [Dev] [Jaggery] Error while calling jaggery post method

2014-08-24 Thread Rajkumar Rajaratnam
Hi Udara, Yes you are right. So Jaggery is not handling empty response body? How we can solve it then? Do we have to return something in the body always? Thanks. On Mon, Aug 25, 2014 at 9:24 AM, Udara Liyanage ud...@wso2.com wrote: Hi Raj, According to the code, response is not empty, but

Re: [Dev] [Jaggery] Error while calling jaggery post method

2014-08-24 Thread Udara Liyanage
Hi, According to the http spec, response to a POST does not send a response body. Resource created is set in location header. Client can identify whether operation is successful by looking at http status code which is 201 in this case. However there is no hard rule that no response body should be

Re: [Dev] [Jaggery] Error while calling jaggery post method

2014-08-24 Thread Rajkumar Rajaratnam
Hi, On Mon, Aug 25, 2014 at 9:42 AM, Udara Liyanage ud...@wso2.com wrote: Hi, According to the http spec, response to a POST does not send a response body. Resource created is set in location header. Client can identify whether operation is successful by looking at http status code which