我在https://upload.twitter.com/1.1/media/upload.json 上使用 postfield进行 POST 请求
'media_data' => base64_encode(file_get_contents($path))
twitter api 总是返回错误“无法识别的媒体类型”。
怎么了?
我试图将 postfield 更改为这些版本:
'media_data' => 'data:image/'.$type.';base64,' . base64_encode(file_get_contents($path)),
'media' => file_get_contents($path),
'media' => realpath($path)...
文件格式:jpeg、jpg