The response returned by an API is of the Response type in Go's HTTP standard library. You can get the error code and message returned by the server through err.Error(). For more information, see Error Codes.
The response returned by an API contains the following call structure:
Member | Description | Type |
---|---|---|
X-Cos-Request-Id | Response header and request ID, which are used to represent a request and are very important for troubleshooting. | string |
StatusCode | Status code in the response. 4xx indicates that the request failed due to a client exception. 5xx indicates that the request failed due to a server exception. For more information, see Error Codes. | string |
COS provides a self-help diagnosis tool to help you quickly locate request problems and debug code.
RequestId
) returned when the request error occurs.RequestId
and click Diagnose.
Apakah halaman ini membantu?