Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIdHttp no ResponseContent on bad request
#1
Wink 
Hello,

1.
with the TIdHTTP i has problems on Rest- Server. Sends the Server on Bad Request (400, 404) the Client doesn’t received the ResponseContent.

I look and found a little workaround. 

I advanced IdHttp.pas

Definition:
TIdCustomHTTP = class(TIdTCPClientCustom)
private
  FRestMode: Boolean;  //Add
  procedure SetRestMode(AValue: Boolean);  //Add

public
  property RestMode: Boolean read FRestMode write SetRestMode; //Add 


Implementation:
procedure TIdCustomHTTP.SetRestMode(AValue: Boolean); //Add
begin
  if FRestMode=AValue then Exit;
  FRestMode:=AValue;
  if FRestMode then begin
    HTTPOptions:= HTTPOptions + [hoNoProtocolErrorException];
  end else begin
    HTTPOptions:= HTTPOptions - [hoNoProtocolErrorException];
  end;
end;

function TIdHTTPProtocol.ProcessResponse(AIgnoreReplies: array of Int16): TidHTTPWhatsNext;

else begin  //From case
  if not FHttp.FRestMode then begin //Add
    CheckException;
    Result := wnJustExit;
    Exit;
  end; //Add
end;

maybe that will help the users too Wink


2.
I have seen, you're working on Indy OpenSSL 1.1.1, very nice, thanks.

My question. When will the new Indy library be added to the Lazarus library.


Thanks for support.
Reply


Messages In This Thread
TIdHttp no ResponseContent on bad request - by fpctuxe - 09-14-2021, 07:33 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)