You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Create src/shade/http_client.py with class _SyncHTTPClient.
Accept api_key, api_base, timeout in the constructor.
Implement request(method, path, params, json) that builds the full URL and returns a parsed response dict.
Set User-Agent: shade-python/{version} on every request.
Use httpx.Client as a context manager internally; keep a single instance alive per ShadeClient.
Acceptance Criteria
GET/POST/PATCH/DELETE requests are issued to the correct fully-qualified URLs.
User-Agent header is present on every request.
Content-Type: application/json is set on POST/PATCH bodies.
The client does not expose httpx types in its public interface.
Closing a ShadeClient closes the underlying httpx.Client.
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 _SyncHTTPClient in src/shade/http_client.py that serves as the shared transport layer for all synchronous resource methods.
Specifically, I would:
Implement _SyncHTTPClient with api_key, api_base, and timeout parameters.
Maintain a single underlying httpx.Client instance for the lifetime of a ShadeClient, 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 any httpx response objects.
Ensure all requests include consistent default headers, including:
User-Agent: shade-python/{version}
Accept: application/json
Content-Type: application/json for 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 underlying httpx.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 httpx types leak through the public interface,
and closing a ShadeClient correctly 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.
I 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 implementation
Hi, 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.py with class _SyncHTTPClient, ensure to
accept api_key, api_base, timeout in the constructor. And i'll implement request(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 is Set User-Agent: shade-python/{version} part of it on every request. I'd love to work on it.
Activity
okeolaolatun23-glitch commentedon Jun 20, 2026
Experienced in backend development, APIs, and OOP, with a strong interest in building scalable and maintainable software systems.
Perruchok commentedon Jun 22, 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 bodiesExpose 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:
httpxtypes leak through the public interface,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 commentedon Jun 25, 2026
🦊 GrantFox — @Perruchok has been assigned to this issue as part of the Official Campaign campaign!
Next steps:
Closes #7)Good luck! Track your progress on GrantFox.
sherifatolanike commentedon Jul 22, 2026
I 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 implementation
grantfox-oss commentedon Jul 24, 2026
🦊 GrantFox — @Perruchok has been assigned to this issue as part of the Official Campaign | FWC26 campaign!
Next steps:
Closes #7)Good luck! Track your progress on GrantFox.
codebestia commentedon Jul 27, 2026
Hello @Perruchok
What is the update with this task.
Please raise a PR soon
DioChuks commentedon Aug 18, 2026
Hi, 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 toaccept
api_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 is
Set User-Agent: shade-python/{version}part of it on every request. I'd love to work on it.grantfox-oss commentedon Aug 21, 2026
🦊 GrantFox — @DioChuks has been assigned to this issue as part of the Third Campaign campaign!
Next steps:
Closes #7)Good luck! Track your progress on GrantFox.
DioChuks commentedon Aug 27, 2026
Thank you, will get started immediately
grantfox-oss commentedon Aug 28, 2026
🎉 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.