ducaale / xh

Friendly and fast tool for sending HTTP requests
MIT License
5.49k stars 96 forks source link

enable stream when content-type is text/event-stream #360

Closed zuisong closed 5 months ago

zuisong commented 5 months ago

closes #204

zuisong commented 5 months ago

I have no idea how to write a test case for this feature.

ducaale commented 5 months ago

Not something to address in this PR but I noticed that HTTPie can format payloads contained in individual events

$ http https://sse.dev/test --body
data: {
    "msg": "It works!",
    "now": 1712764259321,
    "sse_dev": "is great",
    "testing": true
}

data: {
    "msg": "It works!",
    "now": 1712764261322,
    "sse_dev": "is great",
    "testing": true
}