このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン 次のリビジョン 両方とも次のリビジョン | ||
slim:4:response [2020/10/07 17:57] y2sunlight [The Response Body] |
slim:4:response [2020/10/07 21:11] y2sunlight [The Response Body] |
||
---|---|---|---|
行 151: | 行 151: | ||
\\ | \\ | ||
- | ===== The Response Body ===== | + | ===== レスポンスボディ |
HTTPレスポンスには通常、ボディがあります。 | HTTPレスポンスには通常、ボディがあります。 | ||
行 182: | 行 182: | ||
$body-> | $body-> | ||
</ | </ | ||
- | |||
- | You can also replace the PSR-7 Response object’s body with an entirely new '' | ||
- | |||
- | This is particularly useful when you want to pipe content from a remote destination (e.g. the filesystem or a remote API) into the HTTP response. You can replace the PSR-7 Response object’s body with its '' | ||
PSR-7 Responseオブジェクトのボディをまったく新しい '' | PSR-7 Responseオブジェクトのボディをまったく新しい '' | ||
- | これは、コンテンツをリモートの宛先(ファイルシステムやリモートAPIなど)からHTTP応答にパイプ処理する場合に特に便利です。 PSR-7Responseオブジェクトの本体をその | + | これは、コンテンツをリモートの宛先(例えば、ファイルシステムやリモートAPIなど)からHTTPレスポンスにパイプ処理する場合に特に便利です。PSR-7 Responseオブジェクトのボディを '' |
<code php> | <code php> | ||
行 198: | 行 194: | ||
</ | </ | ||
- | >**Reminder** | + | > **注意** |
- | >The Response object is immutable. This method returns a copy of the Response object that contains the new body. | + | > Responseオブジェクトは不変です。このメソッドは、新しい本文を含むResponseオブジェクトのコピーを返します。 |
- | + | ||
- | > **リマインダー** | + | |
- | > Responseオブジェクトは不変です。 このメソッドは、新しい本文を含むResponseオブジェクトのコピーを返します。 | + | |
\\ | \\ |