【发布时间】:2017-12-06 22:24:33
【问题描述】:
我有一个非常简单的 Postman 请求,它在 Postman 中运行良好。这只是对以下 URL 的 GET 请求:
http://www.toysrus.com/storefrontsearch/stores.jsp?skuId=24654884&quantity=1&postalCode=48103&latitude&longitude&productId=107531766&startIndexForPagination=0&searchRadius=0&pageType=product&ispu_or_sts=null&displayAllStoresFlag=false&displayAllStoreLink=false
如果我让 Postman 为我提出一个 cURL 请求,它会给我这个:
curl -X GET \
'http://www.toysrus.com/storefrontsearch/stores.jsp?skuId=24654884&quantity=1&postalCode=48103&latitude=&longitude=&productId=107531766&startIndexForPagination=0&searchRadius=0&pageType=product&ispu_or_sts=null&displayAllStoresFlag=false&displayAllStoreLink=false' \
-H 'cache-control: no-cache' \
-H 'postman-token: b4ae79c0-c3f0-8247-8c2f-306c43376039'
结果是它永远挂起,从来没有给我任何回应。
知道可以做些什么来使 cURL 请求正常工作吗?
【问题讨论】:
-
更新:我发现 GET 请求在 Postman 中可以正常工作,我相信这会稍微简化问题。
-
然后从卷曲线上去掉
-X GET... -
就像我说的,我的
curl命令直接来自 Postman。我推断无论-X GET是否存在,该命令在功能上都是等效的,因此删除它不会改变任何东西。 (我尝试了没有-X GET的命令,只是为了确保我没有发疯,并且请求似乎以同样的方式失败。) -
您的网址无效。它重定向到 404 页面
-
URL 确实有效。