Hi,

I think using a POST with a body, for retrieving information is fine
considering the requirement. GET with body is not recommended.

Thanks.

On Wed, Mar 23, 2016 at 2:31 PM, Gimantha Bandara <giman...@wso2.com> wrote:

> Hi all,
>
>
> We have a REST API in DAS to retrieve records in a specific table. It
> supports GET method with the following url format.
>
> /analytics/tables/{tableName}/{from}/{to}/{start}/{count}
>
> Sending a GET request to above url will give the records between given
> "from", "to" time range starting from index "start" with  "count"  page
> size.
>
> Now we need to change the API, so that the user can define the record
> columns/fields he wants. Current API will return the records with all the
> values/columns. To do that, we can allow the user to define the columns he
> needs, in the payload. But it seems that having a payload with a GET is not
> the convention/the best practice.
>
> POST can be used to send the column names as a payload, but here we are
> not making any updates to {tableName} resource. We will be just retrieving
> records using a POST. So it also seems not the convention/the best practice.
>
> The only solution I can think of is, having a different resource path to
> get the records with only specified fields/columns. Are there any other
> solutions?
>
> Thanks,
> Gimantha
>
>
> _______________________________________________
> Architecture mailing list
> architect...@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 
--
Lahiru Sandaruwan
Committer and PMC member, Apache Stratos,
Senior Software Engineer,
WSO2 Inc., http://wso2.com
lean.enterprise.middleware

phone: +94773325954
email: lahi...@wso2.com blog: http://lahiruwrites.blogspot.com/
linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to