<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ## 生命周期 Response對象在系統中以單例模式存在,自收到客戶端HTTP請求時自動創建,直至請求結束自動銷毀。Response對象完全符合[PSR7](https://www.easyswoole.com/Cn/HttpServer/psr7.html)中的所有規范。 其他細節方法,有興趣的同學可以在IDE中查看對應的代碼。 ## 方法列表 ### write 該方法用于向客戶響應數據。 ~~~ $this->response()->write('hello world'); ~~~ ### redirect 該方法用于將請求重定向至指定的URL ~~~ $this->response()->redirect("/newURL/index.html"); ~~~ ### setCookie 向客戶端設置一個Cookie,用法與原生的setCookie一致。 ### getSwooleResponse 用于獲取原始的swoole\_http\_response實例。 ### end 結束對該次HTTP請求響應,結束之后,無法再次向客戶端響應數據. ### isEndResponse 判斷該次HTTP請求是否結束響應,當你不知道是否已經結束響應時,可通過該方法判斷是否能再次向客戶端響應數據: ~~~php if(!$this->response()->isEndResponse()){ $this->response()->write('繼續發送數據'); } ~~~ ## PSR-7規范Response對象中常用方法 ### withStatus 向客戶端發送HTTP狀態碼。 ~~~php $this->response()->withStatus($statusCode); ~~~ 注意:$statusCode必須為標準的HTTP允許狀態碼,具體請見Http Message中的Status對象。 ### withHeader 用于向HTTP客戶端發送一個header。 ~~~php $this->response()->withHeader('Content-type','application/json;charset=utf-8'); ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看