我刚刚在developer.twitter.com上看到了代码片段
'curl --request POST \
--url https://api.twitter.com/1.1/tweets/search/30day/<ENV>.json \
--header 'authorization: Bearer <BEARER_TOKEN>' \
--header 'content-type: application/json' \
--data '{
"query":"from:TwitterDev lang:en",
"maxResults": "100",
"fromDate":"<YYYYMMDDHHmm>",
"toDate":"<YYYYMMDDHHmm>"
}'
使用cmd命令行或Windows Power Shell,由于代码的多行格式,我收到错误。但是,对于没有换行符的字符串,一切都可以。
我的问题是-我可以在哪里运行此代码段而没有错误?
此命令在Linux和Mac上的bash和zsh中有效-我无法在Windows上对其进行测试。在PowerShell中,多行连续字符是反引号. Remember to replace the
and
values and to edit or remove the
fromDateand
toDate`参数。