I'm making a GET method, call it with link and everything is ok. Here it is:
[OperationContract]
[WebInvoke(
Method = "GET",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
UriTemplate = "/myMethod/{input}",
BodyStyle = WebMessageBodyStyle.Bare
)]
MyClass myMethod(string input);
And here is the url with whom I'm calling it: http://localhost:1234/Service1.svc/json/myMethod/blabla
However, when I'm making a post method, it doesn't work. Here is my POST method:
[OperationContract]
[WebInvoke(
Method = "POST",
ResponseFormat = WebMessageFormat.Json,
RequestFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare
)]
MyClass anotherMethod(string comeOn);
and I call it with this link: http://localhost:1234/Service1.svc/json/anotherMethod?comeOn=smthing and it says Method not allowed.
How do I call a POST method?