Ground Sunlight

Windowsで作る - PHPプログラミングの開発環境

ユーザ用ツール

サイト用ツール


slim:4:response

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
最新のリビジョン 両方とも次のリビジョン
slim:4:response [2020/10/07 21:10]
y2sunlight [The Response Body]
slim:4:response [2020/10/07 21:15]
y2sunlight [Returning a Redirect]
行 1: 行 1:
-> 編集中 
- 
 ====== Slim4 レスポンス ====== ====== Slim4 レスポンス ======
 Version 4.5.0 Version 4.5.0
行 151: 行 149:
 \\ \\
  
-===== The Response Body =====+===== レスポンスボディ =====
  
 HTTPレスポンスには通常、ボディがあります。 HTTPレスポンスには通常、ボディがあります。
行 199: 行 197:
 \\ \\
  
-===== Returning JSON =====+===== JSONを返す =====
  
-In it’s simplest form, JSON data can be returned with a default 200 HTTP status code. +最も単純な形式では、JSONデータはデフォルトの 200 HTTPステータスコードを使用して返すことができます。
- +
-最も単純な形式では、JSONデータはデフォルトの200HTTPステータスコード返すことができます。+
  
 <code php> <code php>
行 213: 行 209:
           ->withHeader('Content-Type', 'application/json');           ->withHeader('Content-Type', 'application/json');
 </code> </code>
- 
-We can also return JSON data with a custom HTTP status code. 
  
 カスタムHTTPステータスコードを使用してJSONデータを返すこともできます。 カスタムHTTPステータスコードを使用してJSONデータを返すこともできます。
行 228: 行 222:
 </code> </code>
  
->**Reminder** 
 >The Response object is immutable. This method returns a copy of the Response object that has a new Content-Type header. This method is destructive, and it replaces the existing Content-Type header. >The Response object is immutable. This method returns a copy of the Response object that has a new Content-Type header. This method is destructive, and it replaces the existing Content-Type header.
  
-> **リマインダー** +> **注意** 
-> Responseオブジェクトは不変です。 このメソッドは、新しいContent-Typeヘッダーを持つResponseオブジェクトのコピーを返します。 このメソッドは破壊的であり、既存のContent-Typeヘッダーを置き換えます。+> Responseオブジェクトは不変です。このメソッドは、新しいContent-Typeヘッダーを持つResponseオブジェクトのコピーを返します。このメソッドは破壊的であり、既存のContent-Typeヘッダーを置き換えます。
  
 \\ \\
  
-===== Returning a Redirect ===== +===== リダイレクトを返す =====
- +
-You can redirect the HTTP client by using the Location header.+
  
 Locationヘッダーを使用して、HTTPクライアントをリダイレクトできます。 Locationヘッダーを使用して、HTTPクライアントをリダイレクトできます。
slim/4/response.txt · 最終更新: 2020/10/07 21:20 by y2sunlight