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

S-108582 Improve http client error and redirection handling #58

Merged
merged 3 commits into from
May 3, 2024

Conversation

jberta-agency04
Copy link
Collaborator

Copy link
Collaborator

@gpugar gpugar left a comment

Choose a reason for hiding this comment

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

I believe we would not change current implementation. Or if we do it's only to display the error message better somewhat what you did.

The implementation should really add additional method that would be equivalent of Do method on existing Go HTTP Client with addition of our creation of a configuration for the request.

return data, fmt.Errorf("%v - %s", resp.StatusCode, string(data[:]))
}

return data, err
}

// doSendHttpRequest sends an HTTP request with a custom configuration and headers, returns whole HTTP response.
func (httpClient *HttpClient) doSendHttpRequest(ctx context.Context, config *RequestConfig) (*http.Response, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

make it DoSendHttpRequest so it's usable outside of the package

@gpugar gpugar merged commit bcbe8ac into master May 3, 2024
1 check passed
@gpugar gpugar deleted the S-108582 branch May 3, 2024 08:20
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.

None yet

2 participants