-
Notifications
You must be signed in to change notification settings - Fork 150
Conversation
Why do we have those at all? Those extra response objects do not bring any value. Any dependency must be on interface, so they can't be used for typehinting. Whatever is creating new XML response, or Json response, could just set content type itself, it already knows enough to do so. |
Test failure is unrelated. IANA published new status code |
Fair enough, but the convenience of not having to repeat yourself whenever you want to return an HTML/Json/Text/XML response is helpful no? |
I suppose I was too hasty to comment. It certainly saves couple lines of code. |
@Xerkus these convenience response types are primarily for application developers, who are producing request handlers/inner middleware, and who already know the PSR-7 implementation they are choosing. Having these is a differentiator with other implementations, and makes producing common response types simpler. The factories in PSR-17, while generally useful, still make some things convoluted (e.g., producing a JSON response, an HTML or XML response, a redirect, etc.). PSR-17, in my mind, is more around writing distributable middleware, where you do not want to make any assumptions about which PSR-7 implementation a consumer is using. |
Add simple XML Response Ref #189
Thanks, @gsteel! |
No description provided.