The requested resource does not support http method 'GET'

Posted by Vuyiswamb under Web Services, Remoting on 6/13/2015 | Points: 10 | Views : 22826 | Status : [Member] [MVP] [Administrator] | Replies : 1
Good Day All

i have a web api with a controller like this

 public class RegistrationController : ApiController
[System.Web.Http.AcceptVerbs("GET", "POST")]
public int Get([FromBody]Registration model)
GetMyContact.Services.Database.Database db = new Database.Database();

var response = Request.CreateResponse<string>(HttpStatusCode.Created, string.Empty);
string uri = Url.Link("DefaultApi", new { id = model.USER_ID });
response.Headers.Location = new Uri(uri);
return model.USER_ID;
catch(Exception ex)
HttpStatusCode statusCode = HttpStatusCode.BadRequest;

var errResponse = Request.CreateResponse<string>(statusCode, ex.Message);
throw new HttpResponseException(errResponse);


and the config is like this

name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }

and i am testing it using the following URL just to see if i will hit that breakpoint http://localhost:39194/api/Registration

but i get the following error on the browser

The requested resource does not support http method 'GET'.


Thank you for posting at Dotnetfunda


Posted by: Jitendrasoft09 on: 6/14/2015 [Member] [MVP] Starter | Points: 25


I am not sure but It could be one of the solution after configuring the custom header in http protocol.

Please refer below link-

Jitendra Kumar
If my post helps you, plz mark as an answer.

Vuyiswamb, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response