在使用Postman或apifox发送es请求时报错缺少认证信息
报错内容
{
"error": {
"root_cause": [
{
"type": "security_exception",
"reason": "missing authentication credentials for REST request [/打码]",
"header": {
"WWW-Authenticate": [
"Basic realm=\"security\" charset=\"UTF-8\"",
"ApiKey"
]
}
}
],
"type": "security_exception",
"reason": "missing authentication credentials for REST request [/打码]",
"header": {
"WWW-Authenticate": [
"Basic realm=\"security\" charset=\"UTF-8\"",
"ApiKey"
]
}
},
"status": 401
}
因为在ES中配置了账号密码,所以在使用Postman或apifox时需要认证
Auth中选择Basic Auth类型
username:配置的账号
password:配置的密码
解决方案图