swift-server / swift-server/async-http-client
HTTPClientRequest looks & feels like a value type but isn't
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 1.1k
- Forks
- 156
- PR merge metrics
- No merged PRs in 30d
Description
Sadly HTTPClientRequest contains a streamable body which is typically a reference to a (frequently) consume-once AsyncSequence. That means it's not actually a value type.
That's a major API winkle that should be fixed as soon as feasible.
My recommendation would be to separate the request and the body. Something like try await httpClient.execute(request, body: myStream).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Begin by reviewing HTTPClientRequest and the current HTTP client execution API, then compare them with the proposed execute(request, body:) shape. Done requires an agreed API design that separates the request from its streamable body and preserves correct consume-once behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- api, networking
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100