如何从developer.twitter.com运行示例

问题描述 投票:0回答:1

我刚刚在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>"
                }'

page of api

使用cmd命令行或Windows Power Shell,由于代码的多行格式,我收到错误。但是,对于没有换行符的字符串,一切都可以。

我的问题是-我可以在哪里运行此代码段而没有错误?

curl twitter sttwitterapi
1个回答
0
投票

此命令在Linux和Mac上的bash和zsh中有效-我无法在Windows上对其进行测试。在PowerShell中,多行连续字符是反引号. Remember to replace theandvalues and to edit or remove the fromDateandtoDate`参数。

© www.soinside.com 2019 - 2024. All rights reserved.