Skip to content
New issue

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

Go sdk , needs to support the decoding of response type 'Content-type': 'text/plain; charset=utf-8' #52

Open
Ramv4694 opened this issue Oct 18, 2024 · 0 comments

Comments

@Ramv4694
Copy link

When encountering the GatewayTimeout error with the message "Cannot get a timely response for this API request." and the message ID "bullwinkle_gateway_timeout" upon making an API request, the response header indicates Content-Type: text/plain; charset=utf-8. The response body in this case is a JSON-formatted error message.

However, the current Go SDK does not support handling this content type correctly, leading to an "undefined response type" at https://github.com/CiscoDevNet/intersight-go/blob/main/client.go#L781 and failing to process the error message at https://github.com/CiscoDevNet/intersight-go/blob/main/client.go#L833C21-L833C44.

To address this, the decode function in the SDK should be enhanced to support the text/plain; charset=utf-8 content type. This improvement will ensure that JSON-formatted error messages in plain text responses are correctly parsed and returned to the user, providing a more accurate and informative error response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant