简体   繁体   English

如何使用 curl 发送推文?

[英]How to send tweets with curl?

I need help because in my team we are using an old version of php and its impossible to use any bundle.我需要帮助,因为在我的团队中,我们使用的是旧版本的 php 并且不可能使用任何捆绑包。

I'm trying to make the request with curl but Im having a lot of problems with authentication.我正在尝试使用 curl 发出请求,但我在身份验证方面遇到了很多问题。

Could anyone tell me how to make a simple curl request to send a tweet using the twitter api?谁能告诉我如何使用 twitter api 发出简单的 curl 请求来发送推文?

Thanks a lot!!非常感谢!!

    curl -X POST 'https://api.twitter.com/2/tweets/search/stream/rules' \
-H "Content-type: application/json" \
-H "Authorization: Bearer $APP_ACCESS_TOKEN" -d \
'{
  "add": [
    {"value": "cat has:images", "tag": "cats with images"}
  ]
}'

it's just an example - but it's nicely described in the documentation这只是一个例子 - 但它在文档中有很好的描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM