在运行上述代码(从Spotify API获取艺术家)后,我一直在我的幻灯片中得到这个错误:
curl --request GET \ --url https://api.spotify.com/v1/albums/4aawyAB9vmqN3uQ7FjRGTy \ --header 'Authorization: Bearer XXX'
At line:2 char:5
+ --url 'https://api.spotify.com/v1/search?q=Lilbaby&type=artist' \
+ ~
Missing expression after unary operator '--'.
At line:2 char:5
+ --url 'https://api.spotify.com/v1/search?q=Lilbaby&type=artist' \
+ ~~~
Unexpected token 'url' in expression or statement.
At line:3 char:5
+ --header 'Authorization: Bearer BQCr8A...QoBCa4'
+ ~
Missing expression after unary operator '--'.
At line:3 char:5
+ --header 'Authorization: Bearer BQCr8A...QoBCa4'
+ ~~~~~~
Unexpected token 'header' in expression or statement.
+ CategoryInfo : ParserError: (:) [],
ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingExpressionAfterOperator
我已经试了很多次,但仍然是同样的结果
1条答案
按热度按时间s1ag04yj1#
在PowerShell中
专辑
结果
艺术家
结果
参考资料
1 curl in PowerShell
2 Powershell Invoke-RestMethod Authorization Header
3 Wrangling REST APIs with PowerShell JSON Examples