我似乎無法得到這個簡單的捲曲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