Digvijay Rathore
Digvijay Rathore

Reputation: 126

post method not allowed in iis Express

I am trying to learn to develop a web service using WCF.

I want to use a post method for this example as I have implemented Get method already. The code is :

[OperationContract]
[WebInvoke(Method = "POST",
           RequestFormat= WebMessageFormat.Json,
           ResponseFormat = WebMessageFormat.Json,
           UriTemplate = "Json/{id}")]
public void JsonData(string id)
{
     return "id is :" + id;
}

This is showing method not allowed when I am using a post method at the place of get but its working in get method.

Please help me.

Upvotes: 1

Views: 780

Answers (1)

marc_s
marc_s

Reputation: 754478

If you have Fiddler, you need to go to the Composer tab, pick the method of POST, enter your URL, and then hit Execute:

enter image description here

Upvotes: 2

Related Questions