I have an ASP.NET MVC Web API and I need to call it using Delphi 6. I am trying to use the Indy components (version 9.0.18), I am using the TIdHttp component.
I am using the REST methods, like POST to add, PUT to update and DELETE to delete the records. I got successfully adding, updating and getting my records, but I couldn't get successfully to call the DELETE method. It raises an error "HTTP/1.1 400 Bad Request".
I tried to debug the Web API, but it appers that the request didn't come, cause it doesn't stop in the breakpoint.
The Indy version that I am using doesn't have the method DELETE, so I tried to use the DoRequest method.
My code:
IdHTTP.DoRequest(hmDelete, 'http://localhost/myapp/api/user/1', nil, nil);
If I make the request using Fiddler it works, so my Web API is working well.