HTTP and Networking Protocol Oriented Programming#380
Open
sshropshire wants to merge 11 commits intov3-betafrom
Open
HTTP and Networking Protocol Oriented Programming#380sshropshire wants to merge 11 commits intov3-betafrom
sshropshire wants to merge 11 commits intov3-betafrom
Conversation
Introduce an HTTPClient protocol that defines the interface for performing HTTP requests, mirroring the existing HTTP class API. This is the first step toward adopting protocol-oriented programming in the networking layer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update NetworkingClient to depend on the HTTPClient protocol instead of the concrete HTTP class, enabling dependency injection with any conforming type. HTTP class now explicitly conforms to HTTPClient. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename the class and file across all source references to better reflect its role as the HTTP-based networking client implementation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extract a NetworkingClient protocol from HTTPNetworkingClient and update all source files to depend on the protocol instead of the concrete type, enabling dependency injection with any conforming implementation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Align test files with the HTTPClient and NetworkingClient protocol changes. MockHTTP now conforms to HTTPClient directly instead of subclassing HTTP. Test setup methods updated to use new initializers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename the concrete HTTP class to URLSessionHTTPClient to clearly describe its implementation detail and follow the naming convention of Protocol / ConcreteClient (HTTPClient / URLSessionHTTPClient). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
MikeThorntonPayPal
left a comment
There was a problem hiding this comment.
I think there may be some conflicts with feature/app-switch. That branch added ContentType support on RESTRequest for the OAuth token endpoint and an additionalHeaders param on the GraphQL fetch for passing a Bearer token. Neither appears to be currently accounted for in HTTPNetworkingClient or the NetworkingClient protocol here.
Collaborator
Author
Yeah that checks out |
MikeThorntonPayPal
approved these changes
Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
HTTPClientprotocol andNetworkingClientprotocol to adhere to the best practice of Protocol Oriented Programming.HTTPtoHTTPNetworkingClientMockHTTPClientandMockNetworkingClientby making them implement the new protocols rather than subclassing concrete types.Checklist
Added a changelog entryAuthors