Hi,

IMO we need to have "message" pram either its an error or success.

because if you take status *202 Accepted* doesn't have mechanism to shows
exact accept scenario in detail.  Then we can't go with generic
notification model on frontend and need to write custom implementations on
front end side.





On Fri, Aug 1, 2014 at 3:43 AM, Ayesha Dissanayaka <aye...@wso2.com> wrote:

> Hi Udara,
>
> Thanks a lot for your suggestions.
>
> As I have mentioned earlier, 'code' is a standard  HTTP Status Code.
>
>> "...idea is to derive the response from 'code' property. 'code' will
>> consist standard HTTP Status Codes."
>>
>
> Yes, we can drop "message" property from success response.
>
> Client can identify success or failure by http response code. IMO having
>> both code and message in success is duplicating.
>
>
>
>
> On Thu, Jul 31, 2014 at 9:46 PM, Udara Liyanage <ud...@wso2.com> wrote:
>
>>
>> Hi,
>>
>> How about sending http response code. Then if it is a 200, 201, 204 etc
>> then it can be considered as the success. Then there is no need of sending
>> a message like "something happens successfully" because we can determine it
>> by response code.
>>
>> For instance, when a resource with id abc is added successfully,
>> Response code is 201 with location header containing the URL to the newly
>> created resource abc
>>
>> We need a message format only when there is a error occurred. Response
>> only contains the back end error message.
>>
>> Client can identify success or failure by http response code. IMO having
>> both code and message in success is duplicating. I hope this is the common
>> REST way.
>>
>>
>> Touched, not typed. Erroneous words are a feature, not a typo.
>>
>
>
>
> --
> *Ayesha Dissanayaka*
> Software Engineer,
> WSO2, Inc : http://wso2.com
> <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>
> 20, Palmgrove Avenue, Colombo 3
> E-Mail: aye...@wso2.com <ayshsa...@gmail.com>
>
> _______________________________________________
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to