• <tfoot id='1m9dN'></tfoot>

      <small id='1m9dN'></small><noframes id='1m9dN'>

    1. <i id='1m9dN'><tr id='1m9dN'><dt id='1m9dN'><q id='1m9dN'><span id='1m9dN'><b id='1m9dN'><form id='1m9dN'><ins id='1m9dN'></ins><ul id='1m9dN'></ul><sub id='1m9dN'></sub></form><legend id='1m9dN'></legend><bdo id='1m9dN'><pre id='1m9dN'><center id='1m9dN'></center></pre></bdo></b><th id='1m9dN'></th></span></q></dt></tr></i><div id='1m9dN'><tfoot id='1m9dN'></tfoot><dl id='1m9dN'><fieldset id='1m9dN'></fieldset></dl></div>

        <bdo id='1m9dN'></bdo><ul id='1m9dN'></ul>
      <legend id='1m9dN'><style id='1m9dN'><dir id='1m9dN'><q id='1m9dN'></q></dir></style></legend>

        Twitter api 上传图片总是返回错误“媒体类型无法识别";

        Twitter api upload image always return error quot;media type unrecognizedquot;(Twitter api 上传图片总是返回错误“媒体类型无法识别;)

            • <bdo id='guNvF'></bdo><ul id='guNvF'></ul>

              • <tfoot id='guNvF'></tfoot>
              • <legend id='guNvF'><style id='guNvF'><dir id='guNvF'><q id='guNvF'></q></dir></style></legend>

                <small id='guNvF'></small><noframes id='guNvF'>

                  <tbody id='guNvF'></tbody>
                  <i id='guNvF'><tr id='guNvF'><dt id='guNvF'><q id='guNvF'><span id='guNvF'><b id='guNvF'><form id='guNvF'><ins id='guNvF'></ins><ul id='guNvF'></ul><sub id='guNvF'></sub></form><legend id='guNvF'></legend><bdo id='guNvF'><pre id='guNvF'><center id='guNvF'></center></pre></bdo></b><th id='guNvF'></th></span></q></dt></tr></i><div id='guNvF'><tfoot id='guNvF'></tfoot><dl id='guNvF'><fieldset id='guNvF'></fieldset></dl></div>
                  本文介绍了Twitter api 上传图片总是返回错误“媒体类型无法识别";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 https://upload.twitter.com/1.1/上进行 POST 请求媒体/上传.json带邮局

                  'media_data' => base64_encode(file_get_contents($path))
                  

                  twitter api 总是返回错误媒体类型无法识别".

                  twitter api always return error "media type unrecognized".

                  怎么了?

                  我尝试将 postfield 更改为这些版本:

                  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)...
                  

                  文件格式:jpeg、jpg

                  file formats: jpeg, jpg

                  推荐答案

                  我不知道为什么 media 不适合你,但 media_data 必须是不带标题使用.我用过这种方法,而且效果很好.

                  I'm not sure why media wasn't working for you, but media_data has to be used without the header. I've used it this way and it works.

                  'media_data' => base64_encode(file_get_contents($path));
                  

                  https://github.com/J7mbo/twitter-api-php/blob/1.0.5/test/TwitterAPIExchangeTest.php#L174-L181

                  这篇关于Twitter api 上传图片总是返回错误“媒体类型无法识别";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                  <small id='b8PjY'></small><noframes id='b8PjY'>

                  <i id='b8PjY'><tr id='b8PjY'><dt id='b8PjY'><q id='b8PjY'><span id='b8PjY'><b id='b8PjY'><form id='b8PjY'><ins id='b8PjY'></ins><ul id='b8PjY'></ul><sub id='b8PjY'></sub></form><legend id='b8PjY'></legend><bdo id='b8PjY'><pre id='b8PjY'><center id='b8PjY'></center></pre></bdo></b><th id='b8PjY'></th></span></q></dt></tr></i><div id='b8PjY'><tfoot id='b8PjY'></tfoot><dl id='b8PjY'><fieldset id='b8PjY'></fieldset></dl></div>

                        <tbody id='b8PjY'></tbody>
                      • <tfoot id='b8PjY'></tfoot><legend id='b8PjY'><style id='b8PjY'><dir id='b8PjY'><q id='b8PjY'></q></dir></style></legend>
                          • <bdo id='b8PjY'></bdo><ul id='b8PjY'></ul>