【发布时间】:2020-10-23 10:05:15
【问题描述】:
我们正在为客户端设置报告提要,并且在测试端点时,我们在 cURL(命令行)和 Postman 之间收到了不同的响应。在 Postman 中,请求通过,就好了;我们得到 200-OK 回复。但是,当我们在 cURL 中发送请求时,我们会收到以下回复 curl: (60) SSL certificate problem: certificate has expired
带有卷曲
cURL 请求如下所示:
curl -i -H "content-type: application/json" -d '{"foo": [],"bar": [],"baz": []}' https://test.example.com/notARealEndpoint
与邮递员
Postman 设置很难显示,但它的代码转换如下:
cURL 解释
curl --location --request POST 'https://test.example.com/not/aReal/Endpoint' --header 'Content-Type: application/json' --header 'Content-Type: text/plain' --data-raw '{"foo": [],"bar": [],"baz": []}'
*顺便说一句,这在命令行中运行时返回相同的certificate has expired 错误
HTTP 解释
POST /not/aReal/Endpoint HTTP/1.1
Host: test.example.com
Content-Type: application/json
Content-Type: text/plain
{"foo": [],"bar": [],"baz": []}
【问题讨论】: