问题描述
嗨,我正在尝试为以下邮递员基本身份验证构建URL。用户名中的值是API令牌或API密钥。
我尝试过:
https://company.clearbit.com/v1/domains/find?name=Jackson marketing&Username=myAPIYeywhichisblackedoutinimage
在邮寄中可以使用,但是使用URL可以得到:
{
"error": {
"type": "auth_required","message": "Authentication is required for this action. Sign up at https://clearbit.com"
}
}
如何构造一个适合但又粘贴到浏览器中的URL?
约翰
解决方法
基本身份验证要求您在HTTP请求中设置Authorization header,因此您将无法仅将URL粘贴到浏览器中,您需要使用标头集构造请求(例如您在邮递员中。