Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTTP DELETE request with body
#1
Hi

I have tries to sent a  TIdHTTP.Delete request with  a stream body the same as like a TIdHTTP.Post. Unfortunately there is no overload function for Delete what accept this (Delphi 10.2).

On Internet I found "The latest update to the HTTP 1.1 specification (RFC 7231) explicitly permits an entity body in a DELETE request:"

Is there a workaround so I can send a DELETE request with a body?

Thank you for your answer
Reply
#2
(03-21-2019, 04:40 PM)Maarten de Vries Wrote: Is there a workaround so I can send a DELETE request with a body?

As you have noticed, TIdHTTP does not currently have an overload for the Delete() method that accepts body content. You will have to call the protected DoRequest() method directly, eg:

Code:
type
  TIdHTTPAccess = class(TIdHTTP)
  end;

TIdHTTPAccess(IdHTTP1).DoRequest('DELETE', URL, BodyStreamHere, nil, []);

Reply
#3
It Works, thanx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)