launchdarkly / swift-eventsource

Server-sent events (SSE) client implementation in Swift for iOS, macOS, tvOS, and watchOS
https://launchdarkly.github.io/swift-eventsource/
Other
187 stars 34 forks source link

feat: add dataTaskCompletionHandler to EventSource config #65

Closed jeongshin closed 11 months ago

jeongshin commented 11 months ago

Hi Thanks for great library. It works well with my project!

Requirements

Related issues

I needed to read response data (json error message from server) when request error occurred while creating connection. But only responseCode is available for UnsuccessfulResponseError. So I added config to use completionHandler on creating urlSession dataTask.

Describe the solution you've provided

Added dataTaskCompletionHandler option.

Describe alternatives you've considered

I don't have any other idea to achieve this.

Additional context