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

HTTP Request to Penguin Third-Party Platform Application API Fails During Video Chunk Upload with Status Code 302

Analysis conclusion: Inspecting the information in the response headers reveals HTTP/1.1 302 Moved Temporarily. The request is redirected with a 302 from http://api.om.qq.com to https://api.om.qq.com. The HTTP 302 Found redirect status code indicates that the requested resource has been temporarily moved to the URL specified by the Location header in the HTTP response.

1. An HTTP request to the Penguin third-party platform application interface failed during video file chunk upload, returning a status code of 302. The response object is printed below. Date: 2021/10/12

Plaintext

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] => 
302 Found

302 Found
stgw/1.3.12.4_1.13.5



    [_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] => 
)

2. Analysis conclusion: Inspecting the information in the response headers reveals HTTP/1.1 302 Moved Temporarily. The request is redirected with a 302 from http://api.om.qq.com to https://api.om.qq.com. The HTTP 302 Found redirect status code indicates that the requested resource has been temporarily moved to the URL specified by the Location header in the HTTP response. See Figure 1.

Analysis conclusion: Inspecting the information in the response headers reveals HTTP/1.1 302 Moved Temporarily. The request is redirected with a 302 from http://api.om.qq.com to https://api.om.qq.com. The HTTP 302 Found redirect status code indicates that the requested resource has been temporarily moved to the URL specified by the Location header in the HTTP response.
Figure 1

3. Review the official Penguin interface documentation. URL: https://open.om.qq.com/resources/resourcesCenter . It confirms that the protocol is still HTTP. See Figure 2.

Review the official Penguin interface documentation. URL: https://open.om.qq.com/resources/resourcesCenter . It confirms that the protocol is still HTTP.
Figure 2

4. http://api.om.qq.com . Decide to set its value to: https://api.om.qq.com . Adjust it to the HTTPS protocol.

5. The HTTP request to the Penguin third-party platform application interface succeeded for the video file chunk upload, returning a status code of 200. The response object is printed below. This indicates that after the official interface was adjusted to the HTTPS protocol, the documentation was not updated in time. See Figure 3.

The HTTP request to the Penguin third-party platform application interface succeeded for the video file chunk upload, returning a status code of 200. The response object is printed below. This indicates that after the official interface was adjusted to the HTTPS protocol, the documentation was not updated in time.
Figure 3
Plaintext

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 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系