Repository navigation
Implement sync HTTP client wrapper using httpx #7
Description
Activity
okeolaolatun23-glitch commented
on Jun 20, 2026 More actionsExperienced in backend development, APIs, and OOP, with a strong interest in building scalable and maintainable software systems.
- addedGrantFox OSSIssue tracked in GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignCampaign: Official Campaign
on Jun 20, 2026 I'd like to work on this issue.
I have experience designing Python SDKs and internal client abstractions, and I understand the importance of keeping transport details isolated from the public API. Encapsulating HTTP concerns behind a dedicated internal client improves maintainability, consistency, and makes future enhancements (retries, telemetry, auth changes) much easier.
My approach would be to introduce a private
_SyncHTTPClientinsrc/shade/http_client.pythat serves as the shared transport layer for all synchronous resource methods.Specifically, I would:
-
Implement
_SyncHTTPClientwithapi_key,api_base, andtimeoutparameters. -
Maintain a single underlying
httpx.Clientinstance for the lifetime of aShadeClient, ensuring connection reuse and efficient resource management. -
Add a common
request(method, path, params=None, json=None)method that constructs fully-qualified URLs and returns parsed response dictionaries rather than exposing anyhttpxresponse objects. -
Ensure all requests include consistent default headers, including:
User-Agent: shade-python/{version}Accept: application/jsonContent-Type: application/jsonfor requests with JSON bodies
-
Expose simple internal helpers (
get,post,patch,delete) for use by resource classes while keeping the transport layer entirely private and absent from the public SDK surface. -
Ensure
ShadeClient.close()properly closes the underlyinghttpx.Client, preventing connection leaks and allowing the client to participate cleanly in context-manager workflows. -
Add tests verifying:
- GET, POST, PATCH, and DELETE requests are sent to the correct fully-qualified URLs,
- required headers are attached to every request,
- JSON requests set the appropriate content type,
- no
httpxtypes leak through the public interface, - and closing a
ShadeClientcorrectly closes the shared HTTP client.
The goal is to provide a clean and reusable internal transport layer while preserving a stable, user-friendly SDK interface.
Could you please assign this issue to me? Thank you.
-
grantfox-oss commented
on Jun 25, 2026 grantfox-ossboton Jun 25, 2026 – with GrantFox OSSMore actions🦊 GrantFox — @Perruchok has been assigned to this issue as part of the Official Campaign campaign!
Next steps:
- Open a Pull Request referencing this issue (e.g.,
Closes #7) - Your PR will be reviewed by the ShadeProtocol maintainers
Good luck! Track your progress on GrantFox.
- Open a Pull Request referencing this issue (e.g.,
sherifatolanike commented
on Jul 22, 2026 More actionsI would like to work on this issue I have reviewed the requirements for creating the internal sync HTTP client and I am ready to build the solution
Proposed Approach
1 HTTP Client Wrapper Create SyncHTTPClient wrapping httpx Client with api key api base and timeout settings while setting default headers like User Agent and Content Type application json
2 Method Abstraction Implement request method handling GET POST PATCH and DELETE calls to parse response dicts while keeping httpx types hidden from the public API
3 Lifecycle Management Keep a single httpx Client instance active per ShadeClient and ensure underlying connections close properly on client shutdown
Please assign this issue to me so I can begin drafting the implementationgrantfox-oss commented
on Jul 24, 2026 grantfox-ossboton Jul 24, 2026 – with GrantFox OSSMore actions🦊 GrantFox — @Perruchok has been assigned to this issue as part of the Official Campaign | FWC26 campaign!
Next steps:
- Open a Pull Request referencing this issue (e.g.,
Closes #7) - Your PR will be reviewed by the ShadeProtocol maintainers
Good luck! Track your progress on GrantFox.
- Open a Pull Request referencing this issue (e.g.,
Hello @Perruchok
What is the update with this task.
Please raise a PR soonDioChuks commented
on Aug 18, 2026 ContributorMore actionsHi, i worked on sth similar in a php project, i'm a senior swe and i see that the task ahead requires syncing resource methods via a shared internal HTTP client. I'll go about it by: creating
src/shade/http_client.pywith class_SyncHTTPClient, ensure to
acceptapi_key,api_base,timeoutin the constructor. And i'll implementrequest(method, path, params, json)that builds the full URL and returns a parsed response dict.
It's very important to have one's own user-agent, so i'll also make sure this isSet User-Agent: shade-python/{version}part of it on every request. I'd love to work on it.- addedGrantFox OSSIssue tracked in GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignCampaign: Third Campaignand removedMaybe RewardedIssue may be eligible for a GrantFox rewardIssue may be eligible for a GrantFox rewardGrantFox OSSIssue tracked in GrantFox OSSIssue tracked in GrantFox OSSOfficial CampaignCampaign: Official CampaignCampaign: Official Campaign
on Aug 21, 2026 grantfox-oss commented
on Aug 21, 2026 grantfox-ossboton Aug 21, 2026 – with GrantFox OSSMore actionsThank you, will get started immediately
grantfox-oss commented
on Aug 28, 2026 grantfox-ossboton Aug 28, 2026 – with GrantFox OSSMore actions🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!
@DioChuks's PR #57 was approved and merged by @codebestia.
🏆 @DioChuks: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (357 total points). Track your full progress on GrantFox.
👏 Great work, @DioChuks! Keep contributing to ShadeProtocol.
Description
All sync resource methods need a shared internal HTTP client. This should wrap
httpx.Client, set default headers (Content-Type, Accept, User-Agent), and expose a clean internal interface (get,post,patch,delete) used only by resource classes — never exposed in the public API.Proposed Steps
src/shade/http_client.pywith class_SyncHTTPClient.api_key,api_base,timeoutin the constructor.request(method, path, params, json)that builds the full URL and returns a parsed response dict.User-Agent: shade-python/{version}on every request.httpx.Clientas a context manager internally; keep a single instance alive perShadeClient.Acceptance Criteria
User-Agentheader is present on every request.Content-Type: application/jsonis set on POST/PATCH bodies.httpxtypes in its public interface.ShadeClientcloses the underlyinghttpx.Client.