简体   繁体   English

德尔福休息和认证

[英]Delphi rest and authentication

I have a web .NET service. 我有一个Web .NET服务。 I can connect this web service from web browsers. 我可以从Web浏览器连接此Web服务。 If I write service address first web browser ask username and password than service is connected. 如果我先写服务地址,则Web浏览器会询问用户名和密码,然后再连接服务。

If I connect this web service with delphi . 如果我将此Web服务与delphi连接。 There is error message: 有错误信息:

Error message is "401 Unauthorized" 错误消息为“ 401未经授权”

I am using: 我在用:

  • RESTResponse1 RESTResponse1
  • RESTRequest1 RESTRequest1
  • RESTClient1 and HTTPBasicAuthenticator 1. RESTClient1和HTTPBasicAuthenticator 1。
  • HTTPBasicAuthenticator1 has username and password and RestClient add Authenticator. HTTPBasicAuthenticator1具有用户名和密码,RestClient添加身份验证器。

But I can not connect web service How can I connect it? 但是我无法连接Web服务如何连接它?

To find out the reason for the missing (or wrong) authentication you can use the developer / debug mode in most web browsers. 要找出缺少(或错误)身份验证的原因,可以在大多数Web浏览器中使用开发人员/调试模式。 You could also use Wireshark or a HTTP proxy. 您也可以使用Wireshark或HTTP代理。

Check the response headers of the server. 检查服务器的响应头。 They include information about all supported authentication modes (see RFC 2616 ) 它们包括有关所有受支持的身份验证模式的信息(请参阅RFC 2616

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM