0

我正在创建一个 python 脚本,但我无法让这个脚本正常工作。我有一张图片存储在我的 PC 上,我需要将该图片发送到 StockTwits API。

    myobj = {'access_token': mytoken, 'body': 'test', 'sentiment': 'bullish', 'chart':image_path}

其中 image_path 是我的图像在我的计算机上的路径。

https://api.stocktwits.com/developers/docs/api#messages-create-docs

他们在 CURL 中有一个示例,但对于 python 没有。

当我运行上面的示例时,我收到以下错误:

   {"response":{"status":422},"errors":[{"message":"There was a problem with the URL. Please 
   check to make sure the provided URL is valid"}]}
4

1 回答 1

0

So this fails, for whatever reason. Instead, I put the images onto my own server, and then I called sent the Https://url as the chart parameter.

This was the workaround I found.

于 2021-05-13T03:34:39.100 回答