我似乎无法得到这个简单的卷曲API命令工作。原始示例代码是HTML/Javascript。我使用Chrome运行代码并使用开发人员工具记录会话。 html/js例子工作正常。我复制了chrome网络请求URL并将其插入到curl命令中,但没有运气。以下是Chrome的“更多工具 - >开发人员工具 - >网络 - >头”给我,curl GET JSON API命令不起作用
Request URL:https://api.betterdoctor.com/2016-03-01/doctors?location=37.773,-122.413,100&skip=2&limit=10&user_key=CODE_SAMPLES_KEY_9d3608187
Request Method:GET
Status Code:200 OK
Remote Address:52.9.169.107:443
Referrer Policy:no-referrer-when-downgrade
我想下面的curl命令,只是剪切和粘贴的镀铬效果,
curl -k -H "Content-Type:application/json" -X GET https://api.betterdoctor.com/2016-03-01/doctors?location=37.773,-122.413,100&skip=2&limit=10&user_key=CODE_SAMPLES_KEY_9d3608187
我收到以下错误消息,
{"meta":{"error":true,"message":"Missing user_key","error_code":1000,"http_status_code":401}}'skip' is not recognized as an internal or external command,
operable program or batch file.
'limit' is not recognized as an internal or external command,
operable program or batch file.
'user_key' is not recognized as an internal or external command,
operable program or batch file.
任何想法我可能是做错了?
尝试在引号 '卷曲-k -H“Content-Type的包裹网址:application/json“-X GET”https://api.betterdoctor.com/2016-03-01/doctors?location=37.773,-122.413,100&skip=2&limit=10&user_key=CODE_SAMPLES_KEY_9d3608187“ – Josh