すべてのプロダクト
Search
ドキュメントセンター

:空の戻り値

最終更新日:Mar 20, 2020

HTTP や HTTPS のリクエスト応答結果は、HTTPCode、Header、および Body で構成されます。 リクエストが失敗した場合、リクエストがビジネス ロジックに入らないため、応答の Body が空のことがあります。エラーとして「戻り値は空です。」と返されます。 ただし、重要な部分はメッセージの Header に含まれています。

ユーザーが開始した API リクエストがゲートウェイに到達すると、ゲートウェイはリクエストに成功または失敗した旨の結果メッセージを返します。

応答メッセージの大部分は Header に含まれています。 X-Ca で始まるメッセージはゲートウェイの返したものです。 重要なメッセージは次のとおりです。

  1. X-Ca-Request-Id: 7AD052CB-EE8B-4DFD-BBAF-EFB340E0A5AF
  2. //The unique ID of the request. Once the request reaches the API gateway, the API gateway generates a request ID and returns it to the client through the response header. We recommend that you record the request ID in both the client and backend services for troubleshooting and tracing.
  3. X-Ca-Error-Message: Invalid Url
  4. //An error message returned from the API Gateway. When a request fails, the API Gateway returns the error message to the client through the response header.
  5. X-Ca-Debug-Info: {"ServiceLatency":0,"TotalLatency":2}
  6. //A debug message returned when the debug mode is enabled. The message can be changed later and is used only for reference at the debugging stage.

したがって、リクエストの応答メッセージが空の場合は、応答 Header を確認します。 通常、Body が空のリクエストがゲートウェイに到達すると「戻り値が空です。」といった旨のエラーが返されますが、メッセージの重要な部分は Header に含まれているのです。

ヘッダーも空の場合、リクエストはゲートウェイに到達しなかったことを意味します。 ネットワークの状態を確認します。

HTTP または HTTPS リクエスト ヘッダーを取得して確認する方法は、さまざまな言語で探し出すことができます。