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
- 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.
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.