Skip to content

Implement async HTTP client wrapper using httpx #8

Description

@codebestia

Description

An async counterpart to the sync client using httpx.AsyncClient, enabling use in async frameworks like FastAPI, Starlette, and Django async views. It should share the same configuration and interface as the sync client so resource methods can delegate to either with minimal branching.

Proposed Steps

  • Add _AsyncHTTPClient to http_client.py, mirroring the sync interface with async def request(...).
  • Accept the same constructor arguments as _SyncHTTPClient.
  • Use async with httpx.AsyncClient(...) as client lifecycle management.
  • Extract a shared _build_request(method, path, params, json) helper used by both sync and async versions.

Acceptance Criteria

  • await client.request("GET", "/payments") returns the same response shape as the sync version.
  • The async client can be used in a pytest-asyncio test without event loop conflicts.
  • Closing the async client (via aclose()) is properly awaited.
  • Sync and async clients share URL-building and header logic without duplication.

Activity

  1. fathiaoyinloye commented on Jun 20, 2026

    @fathiaoyinloye

    I'd like to work on this issue.

    I have experience building API clients, asynchronous applications, and automated testing. After reviewing the requirements, I understand that the goal is to introduce an asynchronous client implementation that mirrors the existing synchronous interface while sharing as much request-building logic as possible.

    My approach would be to:

    • Implement an async HTTP client that matches the behavior and interface of the existing sync client.
    • Extract shared request construction logic to avoid duplication between sync and async implementations.
    • Ensure consistent URL building, header handling, and response shapes across both clients.
    • Add proper async lifecycle management, including support for clean client shutdown.
    • Add test coverage for async usage scenarios and verify compatibility with async test environments.
    • Ensure the implementation remains backward compatible with existing consumers.

    I'll make sure the solution is well-tested, maintainable, and aligned with the project's existing architecture.

    Please assign this issue to me if it is available. Thank you!

  2. grantfox-oss commented on Jun 24, 2026

    @grantfox-oss

    🦊 GrantFox — @fathiaoyinloye has been assigned to this issue as part of the Official Campaign campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #8)
    2. Your PR will be reviewed by the ShadeProtocol maintainers

    Good luck! Track your progress on GrantFox.

  3. grantfox-oss commented on Jul 24, 2026

    @grantfox-oss

    🦊 GrantFox — @fathiaoyinloye has been assigned to this issue as part of the Official Campaign | FWC26 campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #8)
    2. Your PR will be reviewed by the ShadeProtocol maintainers

    Good luck! Track your progress on GrantFox.

  4. DioChuks commented on Aug 18, 2026

    @DioChuks
    Contributor

    Hi, i applied for the sync client issue as well, and would love to complete both. This one bothers on the asynchronous nature of handling client connections, an async counterpart to the sync client using httpx.AsyncClient, which enables use in async frameworks like FastAPI, Starlette, and Django async views. It would share the same configuration and interface as the sync client, so resource methods can delegate to either with minimal branching. I'll add _AsyncHTTPClient to http_client.py, mirroring the sync interface with async def request(...).
    Also accepting the same constructor arguments as _SyncHTTPClient.
    Using async with httpx.AsyncClient(...) as client lifecycle management. And i'll ensure the acceptance criteria are met properly.

  5. grantfox-oss commented on Aug 21, 2026

    @grantfox-oss

    🦊 GrantFox — @DioChuks has been assigned to this issue as part of the Third Campaign campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #8)
    2. Your PR will be reviewed by the ShadeProtocol maintainers

    Good luck! Track your progress on GrantFox.

  6. grantfox-oss commented on Aug 29, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!

    @DioChuks's PR #58 was approved and merged by @codebestia.

    🏆 @DioChuks: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (392 total points). Track your full progress on GrantFox.

    👏 Great work, @DioChuks! Keep contributing to ShadeProtocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions