我正在尝试连接FortiSandbox api,guide here。
指南中的代码片段:
我的用户名: admin
我的密码: Aa12345!
cURL:
curl -X POST \
https://10.1.1.170/sys/login/user/ \
-H 'accept: application/json' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: bd3ae694-f400-c723-8955-bfc4e96c8147' \
-d '{
"method": "exec",
"params": [{
"url": "/sys/login/user/",
"data": [{
"user": "admin",
"passwd": "Aa12345!"
}]
}],
"id": 1,
"ver": "2.0"
}'
响应是超文本标记语言,而不是Json、here full HTML content response
请给绝望的人一些HTML回复的建议:
<!DOCTYPE html>
<html lang="en">
<head>
<title>FortiSandbox - Please login</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
.
.
.
发布于 2018-09-17 02:00:49
curl -X POST http://10.1.1.170/jsonrpc -H 'accept: application/json' -H 'cache-control: no-cache' -H 'content-type: application/json' -H 'postman-token: bd3ae694-f400-c723-8955-bfc4e96c8147' -d '{"method": "exec","params": [{"url": "/sys/login/user","data": [{"user": "admin","passwd": "Aa12345!"}]}],"id": 1,"ver": "2.0"}'
https://stackoverflow.com/questions/51279438
复制相似问题