当我尝试使用curl执行shell脚本时,我收到错误403错误

时间:2017-07-17 07:57:11

标签: bash shell curl grafana

当我尝试执行下面的脚本时,我得到403 Forbidden

以下是我的剧本

#!/bin/bash
user="user5"
pass="password5"
email="user5@user.com"
user_data()
{
  cat <<EOF
{
  "name":"$user",
  "email":"$email",
  "login":"$user",
  "password":"$pass"
}
EOF
}
curl -i \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-X POST http://admin:admin@10.10.34.5:32456/api/admin/users

我收到以下错误

HTTP/1.1 403 Forbidden
Content-Type: application/json; charset=UTF-8
Set-Cookie: grafana_sess=f65cc6d3c6d; Path=/; HttpOnly
Date: Mon, 17 Jul 2017 07:53:12 GMT
Content-Length: 31

为什么我收到此错误?

0 个答案:

没有答案