-
Notifications
You must be signed in to change notification settings - Fork 81
HttpWebRequest and WebResponse To HttpClient #1018
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
base: MAJOR.migrate-to-httpclient
Are you sure you want to change the base?
HttpWebRequest and WebResponse To HttpClient #1018
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the codebase from the legacy HttpWebRequest/WebResponse API to the modern HttpClient API. However, the migration contains several critical bugs that will prevent the code from functioning correctly.
Key Changes:
- Updated
GitLabRequestResultto useHttpRequestMessageandHttpResponseMessageinstead ofHttpWebRequestandWebResponse - Modified
RequestOptions.GetRequestStream()to work withHttpRequestMessageusing conditional compilation for different target frameworks - Added new constructor to
WebHeadersDictionaryAdaptorforHttpResponseHeaders
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| NGitLab/RequestOptions.cs | Updated GetRequestStream to use HttpRequestMessage with framework-specific stream reading |
| NGitLab/PublicAPI/net8.0/PublicAPI.Unshipped.txt | Updated API signatures to reflect HttpClient types |
| NGitLab/NGitLab.csproj | Added BOM marker to file |
| NGitLab/Impl/WebHeadersDictionaryAdaptor.cs | Added constructor for HttpResponseHeaders (contains critical bugs) |
| NGitLab/Impl/HttpRequestor.cs | Updated response handling to use HttpResponseMessage and changed header retrieval logic |
| NGitLab/Impl/HttpRequestor.GitLabRequest.cs | Migrated from WebRequest.CreateHttp to HttpClient (contains multiple critical bugs) |
| NGitLab/GitLabRequestResult.cs | Changed property types from HttpWebRequest/WebResponse to HttpRequestMessage/HttpResponseMessage |
Comments suppressed due to low confidence (1)
NGitLab/Impl/HttpRequestor.GitLabRequest.cs:180
- Write to static field from instance method, property, or constructor.
_httpClient = new HttpClient(handler);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.