You are using the overloaded version of TIdHTTP.Post() that sends webform data in "application/x-www-form-urlencoded" format, so that is not the problem.
Your Indy code is posting to '
http://192.168.1.250//ctrl' (note the double '/' before 'ctrl'), whereas you are having Curl post to '
http://192.168.1.250/ctrl' instead. That extra '/' makes a difference. Make sure you are passing a correct URL to TIdHTTP.
Also, you are having Curl use Digest authentication, but you are not using any authentication in TIdHTTP. Make sure you include the 'IdAuthenticationDigest' unit in your 'uses' clause so Indy enables Digest authentication in TIdHTTP, and then supply values for the TIdHTTP.Request.Username and TIdHTTP.Request.Password properties.
Try this:
var
t: string;
Params: TStringList;
begin
try
IdHTTP1.Request.Username := 'Default User';
IdHTTP1.Request.Password := 'robotics';
IdHTTP1.Request.BasicAuthentication := False;
Params := TStringList.Create;
try
Params.Add('restart-mode=restart');
t := IdHTTP1.Post('http://192.168.1.250/ctrl', Params);
finally
Params.Free;
end;
Memo1.Lines.Text := t;
Memo2.Lines.Add(IdHTTP1.ResponseText);
except
on E: Exception do
begin
ShowMessage(E.message);
Memo2.Lines.Text := E.Message;
end;
end;
end;