且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用curl访问Twitter REST API v1.1?

更新时间:2022-04-14 00:12:44

更改参数时, OAuth签名基本字符串确实会发生变化,因此 oauth_signature 标头也不会更改。这就是为什么更改参数时不能重用签名的原因。

When you change the parameters, the OAuth signature base string does change, so the oauth_signature header does also change. That's why you can't reuse the signature when you change the parameters.

如果您想查看针对Twitter API的任何特定请求的curl请求,请查看OS X的 STTwitter 库。该演示项目包括一个GUI客户端,该客户端将向您展示 curl格式的OAuth请求。

If you want to see the curl request for any specific request to Twitter API, have a look at the STTwitter library for OS X. The demo project includes a GUI client that will show you the OAuth request in curl format.

现在,如果您的目标只是从命令行向Twitter发送请求,请查看 twurl Twitter API的命令行客户端。

Now if your goal is just issuing requests to Twitter from command line, check out twurl which is a command-line client for Twitter API.