Ground Sunlight

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

ユーザ用ツール

サイト用ツール


psr:psr18

差分

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

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

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
psr:psr18 [2020/08/28 13:24]
y2sunlight [エラー処理]
psr:psr18 [2020/09/01 11:55] (現在)
tanaka [PSR-18: HTTP Client]
行 1: 行 1:
-> 編集中 
- 
 ====== PSR-18: HTTP Client ====== ====== PSR-18: HTTP Client ======
  
行 24: 行 22:
   * [[psr:psr17|PSR-17: HTTP Factories - HTTPファクトリー]]    * [[psr:psr17|PSR-17: HTTP Factories - HTTPファクトリー]] 
   * PSR-18: HTTP Client - HTTPクライアント   * PSR-18: HTTP Client - HTTPクライアント
-  * [[psr:psr19|PSR-19: PHPDoc tags - PHPDocタグ]] +  * [[psr:psr19|PSR-19: PHPDoc tags(Draft) - PHPDocタグ]] 
  
 ----- -----
行 84: 行 82:
  
 クライアントは、HTTPリクエストをまったく送信できない場合、または HTTPレスポンスを PSR-7 レスポンスオブジェクトにパースできなかった場合にのみ、''Psr\Http\Client\ClientExceptionInterface'' のインスタンスをスローする必要があります( ''MUST'' )。 クライアントは、HTTPリクエストをまったく送信できない場合、または HTTPレスポンスを PSR-7 レスポンスオブジェクトにパースできなかった場合にのみ、''Psr\Http\Client\ClientExceptionInterface'' のインスタンスをスローする必要があります( ''MUST'' )。
- 
-If a request cannot be sent because the request message is not a well-formed HTTP request or is missing some critical piece of information (such as a Host or Method), the Client MUST throw an instance of Psr\Http\Client\RequestExceptionInterface. 
  
 リクエストメッセージが整形式のHTTPリクエストではないか、重要な情報(ホストやメソッドなど)がないためにリクエストを送信できない場合、クライアントは ''Psr\Http\Client\RequestExceptionInterface'' のインスタンスをスローする必要があります( ''MUST'' )。 リクエストメッセージが整形式のHTTPリクエストではないか、重要な情報(ホストやメソッドなど)がないためにリクエストを送信できない場合、クライアントは ''Psr\Http\Client\RequestExceptionInterface'' のインスタンスをスローする必要があります( ''MUST'' )。
- 
-If the request cannot be sent due to a network failure of any kind, including a timeout, the Client MUST throw an instance of Psr\Http\Client\NetworkExceptionInterface. 
  
 タイムアウトを含むあらゆる種類のネットワーク障害が原因でリクエストを送信できない場合、クライアントは ''Psr\Http\Client\NetworkExceptionInterface'' のインスタンスをスローする必要があります( ''MUST'' )。 タイムアウトを含むあらゆる種類のネットワーク障害が原因でリクエストを送信できない場合、クライアントは ''Psr\Http\Client\NetworkExceptionInterface'' のインスタンスをスローする必要があります( ''MUST'' )。
- 
-Clients MAY throw more specific exceptions than those defined here (a TimeOutException or HostNotFoundException for example), provided they implement the appropriate interface defined above. 
  
 クライアントは、上記で定義された適切なインターフェースを実装している場合、ここで定義されたものよりも具体的な例外(例えば、 ''TimeOutException'' または ''HostNotFoundException'' )をスローできます( ''MAY'' )。 クライアントは、上記で定義された適切なインターフェースを実装している場合、ここで定義されたものよりも具体的な例外(例えば、 ''TimeOutException'' または ''HostNotFoundException'' )をスローできます( ''MAY'' )。
行 112: 行 104:
 { {
     /**     /**
-     * Sends a PSR-7 request and returns a PSR-7 response. 
      * PSR-7リクエストを送信し、PSR-7レスポンスを返します。      * PSR-7リクエストを送信し、PSR-7レスポンスを返します。
      *      *
      * @param RequestInterface $request      * @param RequestInterface $request
-     * 
      * @return ResponseInterface      * @return ResponseInterface
      *      *
-     * @throws \Psr\Http\Client\ClientExceptionInterface If an error happens while processing the request. +     * @throws \Psr\Http\Client\ClientExceptionInterface リクエストの処理中にエラーが発生した場合。 
-                                                       リクエストの処理中にエラーが発生した場合。+                                                       
      */      */
     public function sendRequest(RequestInterface $request): ResponseInterface;     public function sendRequest(RequestInterface $request): ResponseInterface;
行 134: 行 124:
  
 /** /**
- * Every HTTP client related exception MUST implement this interface. 
  * すべてのHTTPクライアント関連の例外は、このインターフェイスを実装する必要があります。  * すべてのHTTPクライアント関連の例外は、このインターフェイスを実装する必要があります。
  */  */
行 152: 行 141:
  
 /** /**
- * Exception for when a request failed. 
  * リクエストが失敗した場合の例外。  * リクエストが失敗した場合の例外。
  *  *
- * Examples: 
-      - Request is invalid (e.g. method is missing) 
-      - Runtime request errors (e.g. the body stream is not seekable) 
  * 例:  * 例:
       -リクエストが無効です(メソッドが見つからないなど)       -リクエストが無効です(メソッドが見つからないなど)
行 165: 行 150:
 { {
     /**     /**
-     * Returns the request. 
      * リクエストを返します。      * リクエストを返します。
      *      *
-     * The request object MAY be a different object from the one passed to ClientInterface::sendRequest() 
      * リクエストオブジェクトは、ClientInterface::sendRequest()に渡されるオブジェクトとは      * リクエストオブジェクトは、ClientInterface::sendRequest()に渡されるオブジェクトとは
      * 異なるオブジェクトである可能性があります      * 異なるオブジェクトである可能性があります
行 188: 行 171:
  
 /** /**
- * Thrown when the request cannot be completed because of network issues. 
  * ネットワークの問題のためにリクエストを完了できない場合にスローされます。  * ネットワークの問題のためにリクエストを完了できない場合にスローされます。
  *  *
- * There is no response object as this exception is thrown when no response has been received. 
  * この例外は、応答が受信されなかった場合にスローされるため、応答オブジェクトはありません。  * この例外は、応答が受信されなかった場合にスローされるため、応答オブジェクトはありません。
  *  *
- * Example: the target host name can not be resolved or the connection failed. 
  * 例:ターゲットホスト名を解決できないか、接続が失敗しました。  * 例:ターゲットホスト名を解決できないか、接続が失敗しました。
  */  */
行 201: 行 181:
     /**     /**
      * Returns the request.      * Returns the request.
-     * リクエストを返します。 
      *      *
-     * The request object MAY be a different object from the one passed to ClientInterface::sendRequest() 
      * リクエストオブジェクトは、ClientInterface::sendRequest()に渡されるオブジェクトとは      * リクエストオブジェクトは、ClientInterface::sendRequest()に渡されるオブジェクトとは
      * 異なるオブジェクトである可能性があります      * 異なるオブジェクトである可能性があります
行 214: 行 192:
  
 \\ \\
- 
  
psr/psr18.1598588644.txt.gz · 最終更新: 2020/08/28 13:24 by y2sunlight