Hi,

While implementing ES - REST API, since there are several response messages
(both Error and Success) we thought of unifying response messages using a
response-builder.

Then the response message will be a JSON object with following body.

*Error Response*

> {
>     code: <>,
>     message: "<>"
> }
>

*Success Response*

> {
>     code: <>,
>     message: "<>"
>     data: [<>]
> }
>

Messages can be processed at the receiving end according to the above
convention.

-- 
*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

Reply via email to