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

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## 請求 請求組件用來獲取所有 HTTP 請求參數,基于 [PSR-7](https://www.php-fig.org/psr/psr-7/) / [PSR-17](https://www.php-fig.org/psr/psr-17/) 標準實現。 ## 組件 使用 [composer]([https://www.phpcomposer.com/](https://www.phpcomposer.com/)) 安裝: ~~~ composer require mix/http-message ~~~ ## 來源 請求類定義于 `mix/http-message` 庫,由 `mix/http-server` 的 `HandlerInterface::handleHTTP` 方法中獲取,最終會傳遞到控制器的構造方法與調用方法中。 - [Router.php#L210](https://github.com/mix-php/route/blob/master/src/Router.php#L210) - [IndexController.php#L17](https://github.com/mix-php/mix-skeleton/blob/master/app/Web/Controllers/IndexController.php#L17) ## PSR 定義方法 | 方法 | 描述 | | --- | --- | | getContext() : \Mix\Context\Context | 獲取上下文 | | getProtocolVersion() : string | 獲取協議版本 | | getHeaders() : array | 獲取全部header | | hasHeader($name) : bool | 判斷 header 是否存在 | | getHeader($name) : array | 獲取 header (http協議header是可以同名的) | | getHeaderLine($name) : string | 獲取 header 單行 (逗號分隔) | | getBody() : StreamInterface | 獲取主體原始內容 | | getMethod() : string | 獲取請求方法 | | getUri() : UriInterface | 獲取請求uri | | getSwooleRequest() : \Swoole\Http\Request | 獲取 swoole 請求對象 | | getServerParams() : array | 獲取服務器參數 | | getCookieParams() : array | 獲取Cookie| | getQueryParams() : array | 獲取請求參數 (GET) | | getUploadedFiles() : UploadedFileInterface[] | 獲取上傳文件 | | getParsedBody() : null \| array | 獲取解析主體 (POST) | | getAttributes() : array | 獲取全部屬性 (GET/POST/Cookie) | | getAttribute($name, $default = null) | 獲取屬性 | ## Context 請求上下文 Web 開發中經常會有一些數據會需要貫穿整個請求中,這些數據可以保存到 Context 中,比如:中間件中獲取用戶的 member_id 保存到上下文中,控制器中取出 member_id 并處理。 - 獲取上下文對象 ~~~ $context = $request->getContext(); ~~~ - 保存數據 ~~~ $context->withValue('key', $value); ~~~ - 獲取數據 ~~~ $value = $context->value('key'); ~~~
                  <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>

                              哎呀哎呀视频在线观看