Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sake92
Copy link
Owner

@sake92 sake92 commented Apr 1, 2025

Fixes #18

@lolgab does this help with your usecase?

Btw I've added a test example that has another workaround for your original issue.
Just avoid returning a body in Response..

@lolgab
Copy link
Contributor

lolgab commented Apr 1, 2025

Wait, if you depend on requests-Scala you already depend on Geny :)
Which means that there is no tradeoff in adding geny support 😍
I was worried about adding another dependency for so little code.

Response.withBody(genyReadable)
case GET -> Path("imperative") =>
Request.current.underlyingHttpServerExchange.getOutputStream.write("hello".getBytes(StandardCharsets.UTF_8))
Response.withStatus(200)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's cool, I didn't know it was possible:)

@sake92
Copy link
Owner Author

sake92 commented Apr 1, 2025

Wait, if you depend on requests-Scala you already depend on Geny :) Which means that there is no tradeoff in adding geny support 😍 I was worried about adding another dependency for so little code.

Ah yes, I forgot haha

@sake92 sake92 merged commit c547984 into main Apr 1, 2025
2 checks passed
@sake92 sake92 deleted the add-geny branch April 1, 2025 12:33
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.

Support writing to java.io.OutputStream

3 participants