我有一个非常简单的 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 请求正常工作吗?
服务器似乎已禁止 curl 用户代理,还troute=t1需要设置cookie ,否则返回 404 :
curl -L -H 'User-Agent: Mozilla' \
-H 'Cookie: troute=t1;' \
'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' --compressed
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14802 次 |
| 最近记录: |