Skip to content

Conversation

@mattt
Copy link
Contributor

@mattt mattt commented May 6, 2025

This PR updates HTTPClientTransport to use the EventSource package for processing server-sent events, replacing the ad hoc implementation with a more exhaustively tested dependency.

This PR also incorporates changes by @stallent in #91, specifically:

  • Handling 405 response for streaming GET requests: If a server doesn't support streaming from the GET endpoint, it should return a 405. In response, the client cancels the streaming task.
  • Add support for streams coming back from POST requests: This involves changing session.data(for: request) to session.bytes(for: request) in the send function and adding logic to process the SSE stream or JSON data from the response stream.

@mattt mattt force-pushed the mattt/eventsource branch from 582e012 to 1c2f039 Compare May 6, 2025 11:57
@mattt mattt merged commit 3ff1085 into main May 6, 2025
6 checks passed
@mattt mattt deleted the mattt/eventsource branch May 6, 2025 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants