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

Example for HTTPResponse error #15598

Merged
merged 1 commit into from
Sep 20, 2021
Merged

Conversation

seankane-msft
Copy link
Member

Closes #15587

@seankane-msft seankane-msft merged commit 97af53c into Azure:main Sep 20, 2021
@seankane-msft seankane-msft deleted the azcore-doc branch September 20, 2021 15:51
}
}
// Do something with response
fmt.Println(ioutil.ReadAll(resp.Body))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we check that resp is not nil? Ie, are azcore.HTTPResponse's the only errors that can come back here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So HTTPResponse is the interface used to get at the underlying *http.Response from an error returned by SDK code due to a failure HTTP status code. In the context of this example, Do() will never return an HTTPResponse error because there's no HTTP status code to predicate success/failure.

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

Successfully merging this pull request may close these issues.

[Core] Add documentation of azcore.HTTPResponse interface
3 participants