Multiple choice technology programming languages

How to define a service as REST based service in WCF?

  1. [ServiceContract] interface IStock { [OperationContract] [WebGet] int GetStock(string StockId); }

  2. [ServiceContract] interface IStock { [OperationContract] [WebInvoke] int GetStock(string StockId); }

  3. a and b

  4. None

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

WCF REST services are created by adding WebGet (for HTTP GET) or WebInvoke (for other HTTP methods) attributes to operation contracts. Both approaches are valid for creating RESTful services.