Arvind Singh Baghel

Arvind Singh Baghel

  • 595
  • 1.7k
  • 72.5k

'Method not allowed' for the POST method

Aug 29 2016 3:17 AM
I have created a WCF REST service within that i created Get method and POST method 
[WebGet(UriTemplate = "/GetOrderDetails/{OrderID}",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
OrderContract GetOrderDetails(string OrderID);
[WebInvoke(UriTemplate = "/PlaceOrder2",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json, Method = "POST")]
bool PlaceOrder2(string order);
i am able to call the GET method, but i am not able to call the POST method i am getting Error as 
 Method not allowed
i tried like : http://localhost:51094/OrderService.svc/PlaceOrder2/54
Please let me know two thing:
1. where i am wrong ?
2. How to pass resolve that error.
3. how to pass complex object as json and call the method.

Answers (3)