【发布时间】:2018-07-18 09:14:10
【问题描述】:
我收到以下错误
{ error:
{ Error: Nock: No match for request {
"method": "GET",
"url": "http://localhost:3000/admin/orders/30075889/transactions.json",
"headers": {
"content-type": "application/json",
"host": "localhost:3000"
}
} Got instead {
"method": "GET",
"url": "http://localhost:3000/admin/orders/30075889/transactions.json",
"headers": {
"content-type": "application/json",
"host": "localhost:3000"
}
}
url和预期一样,不知道哪里错了,有指针吗?
【问题讨论】:
-
我正在调用 2 个 api,1 个是 post,1 个是 get。并做 Promise.all([1stApi, 2edApi])。但得到错误 - 错误:诺克:请求不匹配。当我将两者中的任何 1 放入 Promise.all() 中时,就可以正常工作了。有什么建议为什么会在 2 次 api 调用中发生这种情况?