--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+...@googlegroups.com.
Visit this group at http://groups.google.com/group/api-craft?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "API Craft" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/api-craft/XvTLHONyTsw/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to api-craft+...@googlegroups.com.
There's absolutely nothing wrong with that from a technical point of view. Just make sure you include a Content-Location header if you do include the representation in the POST response so there's visibility that the response body represents the state of some other resource and not the target of the request.
Giving clients extra options does make your API slightly more complicated as it creates more for people to read in order to fully understand how it works. In this case its not much but I generally avoid giving clients any choice like that until they actually demand it - in order to keep the API as simple as possible.
Cheers,
M
There's absolutely nothing wrong with that from a technical point of view. Just make sure you include a Content-Location header if you do include the representation in the POST response so there's visibility that the response body represents the state of some other resource and not the target of the request.
Giving clients extra options does make your API slightly more complicated as it creates more for people to read in order to fully understand how it works. In this case its not much but I generally avoid giving clients any choice like that until they actually demand it - in order to keep the API as simple as possible.
--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+...@googlegroups.com.
Visit this group at http://groups.google.com/group/api-craft?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to a topic in the Google Groups "API Craft" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/api-craft/XvTLHONyTsw/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to api-craft+...@googlegroups.com.
Hi Todd,
On 7 Mar 2013 20:27, "Todd" <to...@goneopen.com> wrote:
>
>
> On Friday, 8 March 2013 07:01:03 UTC+13, Mike Kelly wrote:
>>
>> There's absolutely nothing wrong with that from a technical point of view. Just make sure you include a Content-Location header if you do include the representation in the POST response so there's visibility that the response body represents the state of some other resource and not the target of the request.
>>
>> Giving clients extra options does make your API slightly more complicated as it creates more for people to read in order to fully understand how it works. In this case its not much but I generally avoid giving clients any choice like that until they actually demand it - in order to keep the API as simple as possible.
>
> Three questions:
> would you return the resource or the representation? resource being effectively a copy of the POST data elements, representation being both the links and the data elements. I suspect you are meaning only the former
Yes, the former
> What effect is there on then NOT doing a GET on the representation? (ie that representation isn't yet cached in the network)
Pretty much, yep
> Is returning content on the 201 a simply an optimisation trade-off or is it something more complex?
As far as I can tell it is just an optimisation thing
Cheers,
M
> would you return the resource or the representation? resource being effectively a copy of the POST data elements, representation being both the links and the data elements. I suspect you are meaning only the former
Yes, the former
> What effect is there on then NOT doing a GET on the representation? (ie that representation isn't yet cached in the network)
Pretty much, yep
> Is returning content on the 201 a simply an optimisation trade-off or is it something more complex?
As far as I can tell it is just an optimisation thing