The returned result of an HTTP/HTTPS request consists of the HTTPCode, Header, and Body. When a request fails, the returned Body may be empty because the request does not enter the business logic. The error “The return value is empty.” is returned. However, the important portion of the message is contained in the Header.
If an API request initiated by a user reaches the gateway, the gateway returns the result message indicating a request success or failure.
The majority of the returned messages are contained in the Header. Messages starting with X-Ca are returned from the gateway. Important messages include:
//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.
X-Ca-Error-Message: Invalid Url
//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.
//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.
Therefore, if the returned message of a request is empty, check the returned Header. In normal cases, the Body is empty when the request reaches the gateway and an error is returned stating “The return value is empty.” However, the important portion of the message is contained in the Header.
If the Header is also empty, the request did not reach the gateway. Check your network conditions.
You can search for methods to obtain and view the HTTP/HTTPS request headers in different languages.