We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HttpClient.php 99 行开始,X-Request-Id要都改为小写 } catch (RequestException $e) { if ($e->hasResponse()) { $response = $e->getResponse(); if (isset($this->httpHandler)) { $this->httpHandler->processResponse(['response' => $response, 'logger' => $this->logger]); } $responseStatusCode = $response->getStatusCode(); $requestId = $response->getHeaders()['x-request-id'][0]; $responseBody = $response->getBody(); $sdkError = $this->getSdkErrorMessage($requestId, $responseBody, $responseStatusCode); if (isset($response->getHeaders()['content-length'])) { $contentLength = $response->getHeaders()['content-length'][0]; } else { $contentLength = 0; } if (isset($this->logger)) { $this->logger->addInfo(' "'.$sdkRequest->method.' '. $sdkRequest->url.'" ' .' '.$response->getStatusCode().' '.$contentLength .' '.$response->getHeaders()['x-request-id'][0]); } /* if (400 <= $responseStatusCode and $responseStatusCode < 500) { throw new ClientRequestException($responseStatusCode, $sdkError); } else { throw new ServerResponseException($responseStatusCode, $sdkError); } */ } else { $this->getExceptionType($e->getMessage()); }
} catch (RequestException $e) { if ($e->hasResponse()) { $response = $e->getResponse(); if (isset($this->httpHandler)) { $this->httpHandler->processResponse(['response' => $response, 'logger' => $this->logger]); } $responseStatusCode = $response->getStatusCode(); $requestId = $response->getHeaders()['x-request-id'][0]; $responseBody = $response->getBody(); $sdkError = $this->getSdkErrorMessage($requestId, $responseBody, $responseStatusCode); if (isset($response->getHeaders()['content-length'])) { $contentLength = $response->getHeaders()['content-length'][0]; } else { $contentLength = 0; } if (isset($this->logger)) { $this->logger->addInfo(' "'.$sdkRequest->method.' '. $sdkRequest->url.'" ' .' '.$response->getStatusCode().' '.$contentLength .' '.$response->getHeaders()['x-request-id'][0]); } /* if (400 <= $responseStatusCode and $responseStatusCode < 500) { throw new ClientRequestException($responseStatusCode, $sdkError); } else { throw new ServerResponseException($responseStatusCode, $sdkError); } */ } else { $this->getExceptionType($e->getMessage()); }
The text was updated successfully, but these errors were encountered:
已知问题,代码将会在本周晚点更新,这里的x-request-id的解析会支持全小写(x-request-id),大部分的华为云服务是按照X-Request-Id 来返回的
Sorry, something went wrong.
No branches or pull requests
HttpClient.php 99 行开始,X-Request-Id要都改为小写
} catch (RequestException $e) { if ($e->hasResponse()) { $response = $e->getResponse(); if (isset($this->httpHandler)) { $this->httpHandler->processResponse(['response' => $response, 'logger' => $this->logger]); } $responseStatusCode = $response->getStatusCode(); $requestId = $response->getHeaders()['x-request-id'][0]; $responseBody = $response->getBody(); $sdkError = $this->getSdkErrorMessage($requestId, $responseBody, $responseStatusCode); if (isset($response->getHeaders()['content-length'])) { $contentLength = $response->getHeaders()['content-length'][0]; } else { $contentLength = 0; } if (isset($this->logger)) { $this->logger->addInfo(' "'.$sdkRequest->method.' '. $sdkRequest->url.'" ' .' '.$response->getStatusCode().' '.$contentLength .' '.$response->getHeaders()['x-request-id'][0]); } /* if (400 <= $responseStatusCode and $responseStatusCode < 500) { throw new ClientRequestException($responseStatusCode, $sdkError); } else { throw new ServerResponseException($responseStatusCode, $sdkError); } */ } else { $this->getExceptionType($e->getMessage()); }
The text was updated successfully, but these errors were encountered: