没有不值得去解决的问题,也没有不值得去学习的技术!

企鹅号的第三方平台应用接口HTTP请求,视频文件分片上传失败,状态码:302

分析结论,查看响应头中的信息,HTTP/1.1 302 Moved Temporarily。从 http://api.om.qq.com 302 跳转至 https://api.om.qq.com 。HTTP 302 Found 重定向状态码表明请求的资源被暂时的移动到了由该HTTP响应的响应头Location 指定的 URL 上。
1、企鹅号的第三方平台应用接口HTTP请求,视频文件分片上传失败,状态码:302。打印响应对象。时间:2021/10/12
<pre class="wp-block-syntaxhighlighter-code">

yii\httpclient\Response Object
(
    [client] => yii\httpclient\Client Object
        (
            [baseUrl] => http://api.om.qq.com
            [formatters] => Array
                (
                )

            [parsers] => Array
                (
                )

            [requestConfig] => Array
                (
                )

            [responseConfig] => Array
                (
                )

            [contentLoggingMaxSize] => 2000
            [_transport:yii\httpclient\Client:private] => yii\httpclient\CurlTransport Object
                (
                    [_events:yii\base\Component:private] => Array
                        (
                        )

                    [_eventWildcards:yii\base\Component:private] => Array
                        (
                        )

                    [_behaviors:yii\base\Component:private] => 
                )

            [_events:yii\base\Component:private] => Array
                (
                )

            [_eventWildcards:yii\base\Component:private] => Array
                (
                )

            [_behaviors:yii\base\Component:private] => Array
                (
                )

        )

    [_headers:yii\httpclient\Message:private] => Array
        (
            [0] => HTTP/1.1 302 Moved Temporarily
            [1] => Server: stgw/1.3.12.4_1.13.5
            [2] => Date: Tue, 12 Oct 2021 03:01:13 GMT
            [3] => Content-Type: text/html
            [4] => Content-Length: 169
            [5] => Connection: keep-alive
            [6] => Location: https://api.om.qq.com/video/authuploadtrunk?access_token=L3JWJY62NKATAKX4YHE7DA&openid=4a4e3035a68accadc82b91156a9a0821&transaction_id=781312031335346181&start_offset=0
        )

    [_cookies:yii\httpclient\Message:private] => 
    [_content:yii\httpclient\Message:private] => <html>
<head><title>302 Found</title></head>
<body bgcolor="white">
<center><h1>302 Found</h1></center>
<hr><center>stgw/1.3.12.4_1.13.5</center>
</body>
</html>

    [_data:yii\httpclient\Message:private] => 
    [_format:yii\httpclient\Message:private] => 
    [_events:yii\base\Component:private] => Array
        (
        )

    [_eventWildcards:yii\base\Component:private] => Array
        (
        )

    [_behaviors:yii\base\Component:private] => 
)

</pre>
2、分析结论,查看响应头中的信息,HTTP/1.1 302 Moved Temporarily。从 http://api.om.qq.com 302 跳转至 https://api.om.qq.com 。HTTP 302 Found 重定向状态码表明请求的资源被暂时的移动到了由该HTTP响应的响应头Location 指定的 URL 上。如图1
分析结论,查看响应头中的信息,HTTP/1.1 302 Moved Temporarily。从 http://api.om.qq.com 302 跳转至 https://api.om.qq.com 。HTTP 302 Found 重定向状态码表明请求的资源被暂时的移动到了由该HTTP响应的响应头Location 指定的 URL 上。
图1
3、查看企鹅号的官方接口文档。网址:https://open.om.qq.com/resources/resourcesCenter 。确定仍然是 http 协议。如图2
查看企鹅号的官方接口文档。网址:https://open.om.qq.com/resources/resourcesCenter 。确定仍然是 http 协议。
图2
4、http://api.om.qq.com 。决定设置其值:https://api.om.qq.com 。调整为 https 协议。 5、企鹅号的第三方平台应用接口HTTP请求,视频文件分片上传成功,状态码:200。打印响应对象。说明官方接口调整为 https 协议后,文档未及时更新。如图3
企鹅号的第三方平台应用接口HTTP请求,视频文件分片上传成功,状态码:200。打印响应对象。说明官方接口调整为 https 协议后,文档未及时更新。
图3


yii\httpclient\Response Object
(
    [client] => yii\httpclient\Client Object
        (
            [baseUrl] => https://api.om.qq.com
            [formatters] => Array
                (
                )

            [parsers] => Array
                (
                )

            [requestConfig] => Array
                (
                )

            [responseConfig] => Array
                (
                )

            [contentLoggingMaxSize] => 2000
            [_transport:yii\httpclient\Client:private] => yii\httpclient\CurlTransport Object
                (
                    [_events:yii\base\Component:private] => Array
                        (
                        )

                    [_eventWildcards:yii\base\Component:private] => Array
                        (
                        )

                    [_behaviors:yii\base\Component:private] => 
                )

            [_events:yii\base\Component:private] => Array
                (
                )

            [_eventWildcards:yii\base\Component:private] => Array
                (
                )

            [_behaviors:yii\base\Component:private] => Array
                (
                )

        )

    [_headers:yii\httpclient\Message:private] => Array
        (
            [0] => HTTP/1.1 100 Continue
            [1] => HTTP/1.1 200 OK
            [2] => Date: Tue, 12 Oct 2021 03:14:53 GMT
            [3] => Content-Type: application/json;charset=UTF-8
            [4] => Content-Length: 117
            [5] => Connection: keep-alive
            [6] => Server: nginx
        )

    [_cookies:yii\httpclient\Message:private] => 
    [_content:yii\httpclient\Message:private] => {"code":0,"data":{"end_offset":10100677,"start_offset":10100677,"transaction_id":781312034678068161},"msg":"SUCCESS"}
    [_data:yii\httpclient\Message:private] => 
    [_format:yii\httpclient\Message:private] => 
    [_events:yii\base\Component:private] => Array
        (
        )

    [_eventWildcards:yii\base\Component:private] => Array
        (
        )

    [_behaviors:yii\base\Component:private] => 
)


需要长期技术维护或远程问题排查?

我是拥有 15+ 年经验的 PHP / Go 后端工程师,长期关注已有系统维护、Bug 修复、性能优化、服务器排查、WordPress 网站维护和小功能迭代。

如果你的项目遇到以下情况,可以先从一次小问题排查开始合作:

  • ✅ PHP / Laravel / Yii2 老项目无人维护
  • ✅ Go / Gin 后端接口需要排查或优化
  • ✅ WordPress 网站访问慢、报错或插件冲突
  • ✅ Nginx / MySQL / Redis / Linux 服务器异常
  • ✅ CDN / Cloudflare / DNS / HTTPS 配置问题
  • ✅ 需要长期远程技术支持或兼职维护

更多介绍请查看:关于我 & 合作

微信:13980074657
邮箱:shuijingwanwq@gmail.com
Telegram:@shuijingwan
GitHub:https://github.com/shuijingwan

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理