0

I have a Web API in my Azure server and I'm making calls from an ASP.NET Webforms website.

I seem to be able to perform GET with no trouble. Now for the PUT, it's giving me this error:

The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used

I was not able to DELETE either. I see some other topics where people disable some WebDav and stuff on their IIS servers and it works. But on Azure?

Below my code for the PUT:

HttpResponseMessage response = client.GetAsync("api/People/" + id).Result;
if (response.IsSuccessStatusCode)
{
    var yourcustomobjects = response.Content.ReadAsAsync<People>().Result;

    Uri peopleUrl = response.Headers.Location;

    yourcustomobjects.name= "Bob"; 
    response = await client.PutAsJsonAsync(peopleUrl, yourcustomobjects);
    tbDebug.Text += await response.Content.ReadAsStringAsync();
}
Stacked
  • 6,892
  • 7
  • 57
  • 73

1 Answers1

-1

Alright I grew tired of trying to fix this issue by enabling PUT.

So what I did, was I wrote a GET that makes the needed change in the database.

Cheers