首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >API响应是html而不是Json

API响应是html而不是Json
EN

Stack Overflow用户
提问于 2018-07-11 15:18:39
回答 1查看 2.2K关注 0票数 1

我正在尝试连接FortiSandbox api,guide here

指南中的代码片段:

我的用户名: admin

我的密码: Aa12345!

cURL:

代码语言:javascript
复制
    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回复的建议:

代码语言:javascript
复制
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>FortiSandbox - Please login</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        .
        .
        .
EN

回答 1

Stack Overflow用户

发布于 2018-09-17 02:00:49

代码语言:javascript
复制
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"}'
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51279438

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档