Tony,

Using the correct verb can sometimes remove ambiguity and promote
efficiency.

You POST a 30 field form to add a record to your system and later only want
to update one of those fields. If POST was your only verb you would have to
retrieve and re-post all 30 fields so that you could update that one.
Otherwise there would be ambiguity around nullable fields.

If you were to implement PUT or PATCH then your transaction would be
smaller on the wire and you could unambiguously NULL a field that
previously contained a value.

-- 
Regards,
noonie


On 26 March 2017 at 21:59, Tony Wright <tonyw...@gmail.com> wrote:

> Thanks. I'm still reading up on it, but the penny hasn't dropped yet. I'm
> not seeing any real benefit of moving away from just using get and post, as
> to do so requires the team to be more disciplined, and for potentially
> dubious reasons. That is, just because it's seen as being more "correct" is
> not a good enough reason. There is an argument that says it leads to
> "unrequired" overhead but I am yet to come to an understanding of what that
> is supposed to mean.
>
> On 26 Mar 2017 9:52 PM, "Nick Randolph" <n...@builttoroam.com> wrote:
>
>> The other verb you might want to consider is PATCH….. for when you want
>> to update part of an entity but don’t want to send the whole item to the
>> service. Definitely has its uses but it’s really a architectural choice
>> whether you use PUT, PATCH or both.
>>
>>
>>
>> *Nick Randolph* | *Built to Roam Pty Ltd* | Microsoft MVP – Windows
>> Platform Development | +61 412 413 425 <+61%20412%20413%20425> |
>> @thenickrandolph | skype:nick_randolph
>> The information contained in this email is confidential. If you are not
>> the intended recipient, you may not disclose or use the information in this
>> email in any way. Built to Roam Pty Ltd does not guarantee the integrity of
>> any emails or attached files. The views or opinions expressed are the
>> author's own and may not reflect the views or opinions of Built to Roam Pty
>> Ltd.
>>
>>
>>
>> *From:* ozdotnet-boun...@ozdotnet.com [mailto:ozdotnet-bounces@ozdot
>> net.com] *On Behalf Of *Tom Rutter
>> *Sent:* Sunday, 26 March 2017 9:38 PM
>> *To:* ozDotNet <ozdotnet@ozdotnet.com>
>> *Subject:* Re: WebApi - PUT and DELETE
>>
>>
>>
>> http://stackoverflow.com/questions/2493579/why-do-i-need-
>> put-or-delete-http-verbs
>>
>> On Sunday, 26 March 2017, Tom Rutter <therut...@gmail.com> wrote:
>>
>> For "RESTfulness" perhaps
>>
>> On Sunday, 26 March 2017, Tony Wright <tonyw...@gmail.com> wrote:
>>
>> Hi all,
>>
>>
>>
>> I have written a few angular apps and our team has collectively got away
>> with using HttpGet and HttpPost for just about every call to the WebApi
>> services. We never seem to be having any issues.
>>
>>
>>
>> When running through the tutorials for Angular 4 (yes, its out), I have
>> come across yet another learned guru who just uses all 4 of the main verbs
>> when calling webapi - GET, POST, PUT and DELETE. GET for retrieval, POST
>> for new items, PUT for updates and DELETE for, well, deletes. Yes I know
>> what they are meant to be for, but why?
>>
>>
>>
>> I guess the real question is, what am I losing by not using PUT and
>> DELETE?
>>
>>
>>
>> Kind regards,
>>
>> Tony
>>
>>

Reply via email to