Twitter api upload image always return error “media type unrecognized”
问题 I do POST-request on https://upload.twitter.com/1.1/media/upload.json with postfield 'media_data' => base64_encode(file_get_contents($path)) twitter api always return error "media type unrecognized". what's wrong? I tried to change postfield to those versions: 'media_data' => 'data:image/'.$type.';base64,' . base64_encode(file_get_contents($path)), 'media' => file_get_contents($path), 'media' => realpath($path)... file formats: jpeg, jpg 回答1: I'm not sure why media wasn't working for you, but