我正在尝试使用 Indy 9 发送 HTTP DELETE 请求。
尝试(像那样):
type
TIdHTTPAccess = class(TIdHTTP)
end;
TIdHTTPAccess(IdHttp).DoRequest(hmDelete, deleteURL, nil, nil);
这不起作用,因为在 TIdHTTPProtocol.BuildAndSendRequest 中跳过了 hmDelete。
有没有机会使用 Indy 9 发送 HTTP DELETE 请求?
Delpphi 7,Indy 9.00.10,IdHTTP 单元的一部分;
procedure TIdHTTPProtocol.BuildAndSendRequest(AURI: TIdURI);
...
case Request.Method of
hmHead: FHTTP.WriteLn('HEAD ' + Request.URL + ' HTTP/' + ProtocolVersionString[FHTTP.ProtocolVersion]); {do not localize}
hmGet: FHTTP.WriteLn('GET ' + Request.URL + ' HTTP/' + ProtocolVersionString[FHTTP.ProtocolVersion]); {do not localize}
hmPost: FHTTP.WriteLn('POST ' + Request.URL + ' HTTP/' + ProtocolVersionString[FHTTP.ProtocolVersion]); {do not localize}
// HTTP 1.1 only
hmOptions: FHTTP.WriteLn('OPTIONS ' + Request.URL + ' HTTP/' + ProtocolVersionString[FHTTP.ProtocolVersion]); {do not localize}
hmTrace: FHTTP.WriteLn('TRACE ' + Request.URL + ' HTTP/' + ProtocolVersionString[FHTTP.ProtocolVersion]); {do not localize}
hmPut: FHTTP.WriteLn('PUT ' + Request.URL + ' HTTP/' + ProtocolVersionString[FHTTP.ProtocolVersion]); {do not localize}
hmConnect: FHTTP.WriteLn('CONNECT ' + Request.URL + ' HTTP/' + ProtocolVersionString[FHTTP.ProtocolVersion]); {do not localize}
end;
...