Delphi idhttp访问DATASNAP有密码验证的中间件


本文整理自网络,侵删。

 
idhttp访问DATASNAP有密码验证的中间件

用TIDHttp访问DataSnap Rest服务器,在服务器采用了用户验证的情况下,客户端需要提交密码,否则不能正常连接。


procedure TForm15.Button2Click(Sender: TObject);
var
  url, params, Text: string;
  code: Integer;
  http: TIDHttp;
begin
  http:= TIDHttp.Create(nil);
  http.Request.BasicAuthentication := True;
  http.request.password := '密码'; // 提交密码
  params := Edit1.Text;
 
  url:= 'http://192.168.10.182:8081/datasnap/rest/TSM/EchoString/';
  try
    text := http.Get(URL+TIdURI.ParamsEnCode(params));
    Edit2.Text := Text;
  except
    on E: Exception do
    begin
 
    end;
  end;
end;

https://www.cnblogs.com/hnxxcxg/p/11204825.html

相关阅读 >>

Delphi复制文件时,如何显示进度条

Delphi编程实现sql server挂起清除

Delphi word转pdf两种方法

Delphi webbrowser 操作记要

Delphi trestclient + trestrequest + trestresponse

Delphi 泛型排序器 tcomparer

Delphi多线程文件搜索

Delphi 精炼的数字转换人民币大写转换代码

Delphi eof 判断文件指针是否移动到了文件未尾

Delphi 自带gif控件的动画图片加载和播放

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...