Which HTTP verb should you include?

You are developing code that uses an XMLHttpRequest object to update a Microsoft
Dynamics CRM record by using the Representational Stat Transfer (REST) endpoint. You
need to ensure that only the specified fields in the request get updated. Which HTTP verb
should you include?

You are developing code that uses an XMLHttpRequest object to update a Microsoft
Dynamics CRM record by using the Representational Stat Transfer (REST) endpoint. You
need to ensure that only the specified fields in the request get updated. Which HTTP verb
should you include?

A.
MERGE

B.
DELETE

C.
GET

D.
PUT

Explanation:



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Jimbo

Jimbo

DELETE?! TO UPDATE?!

Cecil

Cecil

should be D.

Andriy

Andriy

Yeah, that’s ridiculous. DELETE – no way! It must be MERGE. It’s a tricky question because PUT also can be used to update a record. The difference is that PUT sets default values to the fields for which there is no values in the request.

Carlos

Carlos

I think that the right answer is A. MERGE.

I MSDN documentation, to sends an asynchronous request to update a record, it is used MERGE within $.ajax like this:

// Specify the HTTP method to update just the changes you are submitting
xhr.setRequestHeader(“X-HTTP-Method”, “MERGE”);

You can check it in:
https://msdn.microsoft.com/en-us/library/gg309549(v=crm.7).aspx