madhu
madhu

Reputation: 71

405 error{"Message":"The requested resource does not support http method 'GET'."}

I am using the following code in my interface and using webapi service.

[OperationContract]
[WebInvoke(Method = "GET")]
bool IsPaymentGatewayExitsForTenant(string tenantSlugName, string productCode);

I am running locally and testing the service using rest client

api/PaymentGatewayService/IsPaymentGatewayExitsForTenant?tenantSlugName=KPN&productCode=POSS

But I am getting the following errror enter code here

{"Message":"The requested resource does not support http method 'GET'."} `enter code here`

Any help would be appeciated.

Upvotes: 2

Views: 1897

Answers (1)

wizzardz
wizzardz

Reputation: 5874

Could you please decorate yout controller class method "IsPaymentGatewayExitsForTenant" with "HttpGet" attribute

[System.Web.Http.HttpGet]
bool IsPaymentGatewayExitsForTenant(string tenantSlugName, string productCode)
{
   // your code goes here
}

hopes this works

Upvotes: 5

Related Questions