m0_57299765 2025-03-27 09:10 采纳率: 0%
浏览 12

postman测试dell服务器

问题遇到的现象和发生背景

华为服务器使用postman测试redfish API接口都没问题;同样的步骤测试DELL服务器,可以获取到DELL服务器的redfish版本,说明接口已经开启,但无法获取X-Auth-Token,什么原因?
返回错误:
400 Bad Request
The server could not understand the request. Maybe a bad syntax?

dell服务器请求、和返回的信息

POST http://172.31.32.76/redfish/v1/SessionService/Sessions
POST /redfish/v1/SessionService/Sessions HTTP/1.1
Content-Type: application/json
User-Agent: PostmanRuntime/7.43.2
Accept: */*
Cache-Control: no-cache
Postman-Token: bf2584b1-0b4d-4f2a-806e-585f5caa5469
Host: 172.31.32.76
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 68
 
{
"UserName": "root",
"Password": "9bRX7592"
}
 
HTTP/1.1 400 Bad Request
Keep-Alive: timeout=60, max=199
Content-Type: text/html
Date: Thu, 27 Mar 2025 05:33:37 GMT
Cache-Control: no-cache
Content-Length: 249
Connection: Keep-Alive
Accept-Ranges: bytes
 
<!DOCTYPE html>
<head>
<title>Bad Request</title>
<link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon">
</head>
<body>
<h2>Access Error: 400 -- Bad Request</h2>
<pre>Bad request parameters</pre>
</body>
</html>


操作环境、软件版本等信息

华为服务器型号RH8100v3,"RedfishVersion": "1.0.2"
DELL服务器型号DELL R730xd,"RedfishVersion": "1.0.0"

尝试过的解决方法

postman已经关闭SSL,已经尝试http和https
通过浏览器方式,HTTP直接登录dell服务器该IP的idrac界面,可以正常登录,

我想要达到的结果

如何通过postman测试dell服务器的redfish API接口?
是否有额外的需要检查、配置的选项?包括服务器侧和postman测试软件侧?

  • 写回答

4条回答 默认 最新

  • 阿里嘎多学长 2025-03-27 09:11
    关注

    阿里嘎多学长整理AIGC生成,因移动端显示问题导致当前答案未能完全显示,请使用PC端查看更加详细的解答过程

    问题解答

    你遇到的问题是使用 Postman 测试 DELL 服务器的 Redfish API 接口,虽然可以获取到服务器的 Redfish 版本,但无法获取 X。

    可能的原因是:

    1. DELL 服务器的 Redfish 接口可能需要特殊的认证或授权,例如 Basic Auth、Bearer Token 等。
    2. DELL 服务器的 Redfish 接口可能需要指定的 Content-Type 或 Accept header。

    解决方案:

    1. 检查 DELL 服务器的 Redfish 文档,了解其接口的认证和授权机制。
    2. 在 Postman 中添加相应的认证或授权信息,例如 Basic Auth 或 Bearer Token。
    3. 检查 Content-Type 或 Accept header,确保它们与 DELL 服务器的 Redfish 接口相匹配。

    例如,如果 DELL 服务器的 Redfish 接口需要 Basic Auth,可以在 Postman 中添加 Basic Auth 信息:

    • 在 Postman 中,点击 "Authorization" 选项卡
    • 选择 "Basic Auth"
    • 输入用户名和密码

    如果 DELL 服务器的 Redfish 接口需要 Bearer Token,可以在 Postman 中添加 Bearer Token 信息:

    • 在 Postman 中,点击 "Authorization" 选项卡
    • 选择 "Bearer Token"
    • 输入 Bearer Token

    如果你已经检查了认证和授权信息,但仍然无法获取 X,可以尝试在 Postman 中添加相应的 header,例如:

    • 在 Postman 中,点击 "Headers" 选项卡
    • 添加一个名为 "Content-Type" 的 header,值为 "application/json"
    • 添加一个名为 "Accept" 的 header,值为 "application/json"

    这些解决方案只是可能的解决方案,你需要根据 DELL 服务器的 Redfish 文档和实际情况进行调整。

    评论

报告相同问题?

问题事件

  • 创建了问题 3月27日