Reputation: 21
I have written an API with this format:
[OperationContract]
[WebInvoke(Method = "Get", UriTemplate = "/GetPrice/{ItemID}", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
string GetVegatablePrice(string ItemID);
I got an error:
method not allowed
Upvotes: 1
Views: 62
Reputation: 21
Finally I got answer for this.
Just change method name to "GET"
.
While writing an Http
method, make sure to write in uppercase, like:
"GET"
"PUT"
"POST"
"DELETE"
Upvotes: 1