API 新手...我正在查看此处的文档(https://developers.google.com/url-shortener/v1/getting_started),但无法使用以下命令:
curl https://www.googleapis.com/urlshortener/v1/url?key=<MYAPIKEY> \
-H 'Content-Type: application/json' \
-d '{"longUrl": "http://www.google.com/"}'
收到此错误消息:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Required parameter: shortUrl",
"locationType": "parameter",
"location": "shortUrl"
}
],
"code": 400,
"message": "Required parameter: shortUrl"
}
}
不知道他们为什么要一个 shortUrl 参数,这不是我要他们返回给我的吗?