Which code segment should you use?

You are developing an ASP.NET MVC application.
The application provides a RESTful API for third‐party applications. This API updates the information
for a contact by embedding the information in the URL of an HTTP POST.
You need to save the Contact type when third‐party applications use the EditContact method.
Which code segment should you use? {Each correct answer presents a complete solution. Choose all
that apply.)



You are developing an ASP.NET MVC application.
The application provides a RESTful API for third‐party applications. This API updates the information
for a contact by embedding the information in the URL of an HTTP POST.
You need to save the Contact type when third‐party applications use the EditContact method.
Which code segment should you use? {Each correct answer presents a complete solution. Choose all
that apply.)



A.
Option A

B.
Option B

C.
Option C

D.
Option D

Explanation:
Basics of RESTful services:

REST stands for Representational State Transfer, it is a simple stateless architecture that runs over
HTTP where each unique URL is representation of some resource. There are four basic design
principles which should be followed when creating RESTful service:
* Use HTTP methods (verbs) explicitly and in consistent way to interact with resources (Uniform
Interface), i.e. to retrieve a resource use GET, to create a resource use POST, to update a resource
use PUT/PATCH, and to remove a resource use DELETE.
Etc.



Leave a Reply 5

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


Scar

Scar

B&C are correct. A is obviously wrong, and D is wrong because GetValue is a method so the indexer [] is not valid syntax

FigArt

FigArt

Yeah, should be B and C

Joskagyerek

Joskagyerek

Since this is a POST request only A and B are correct.

Denis

Denis

A & B are correct