IDhttp1.Request.Authentication.Username:=用户名;
代码延伸是:
IDhttp1:= TIDhttp.Create(Application); IDhttp1.ConnectTimeout:= 10000; IDhttp1.Request.Clear; IDhttp1.Request.BasicAuthentication:= true; IDhttp1.Request.Authentication.Username := Username; IDhttp1.Request.Authentication.Password := Password; try IDhttp1.Get(PbxURL); httpCode := IDhttp1.ResponseCode; except on E: EIDhttpProtocolException do httpCode := IDhttp1.ResponseCode;
我正在使用Delphi 2010,并且已经尝试过这样的事情:
IDhttp1.Request.Authentication.Username:=’admin’;
但没有解决问题……
IDhttp1:= TIDhttp.Create(Application);IDhttp1.ConnectTimeout:= 10000;IDhttp1.Request.Clear;IDhttp1.Request.BasicAuthentication:= true;IDhttp1.Request.Username := Username;IDhttp1.Request.Password := Password;总结
以上是内存溢出为你收集整理的delphi – IdHTTP基本身份验证访问冲突全部内容,希望文章能够帮你解决delphi – IdHTTP基本身份验证访问冲突所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)