Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Add simple XML Response Ref #189 #285

Merged
merged 2 commits into from
Jan 4, 2018
Merged

Add simple XML Response Ref #189 #285

merged 2 commits into from
Jan 4, 2018

Conversation

gsteel
Copy link
Contributor

@gsteel gsteel commented Jan 3, 2018

No description provided.

@Xerkus
Copy link
Member

Xerkus commented Jan 3, 2018

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.

@Xerkus
Copy link
Member

Xerkus commented Jan 3, 2018

Test failure is unrelated. IANA published new status code

@gsteel
Copy link
Contributor Author

gsteel commented Jan 3, 2018

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?

@Xerkus
Copy link
Member

Xerkus commented Jan 4, 2018

I suppose I was too hasty to comment. It certainly saves couple lines of code.
You see, there is a PSR-17, HTTP factory interface, that enables consumers not to depend on diactoros at all. On the other hand this little convenience does not really affect interoperability. I can live with it.

@weierophinney
Copy link
Member

@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.

@weierophinney weierophinney merged commit 8a21fff into zendframework:develop Jan 4, 2018
weierophinney added a commit that referenced this pull request Jan 4, 2018
weierophinney added a commit that referenced this pull request Jan 4, 2018
weierophinney added a commit that referenced this pull request Jan 4, 2018
@weierophinney
Copy link
Member

Thanks, @gsteel!

@weierophinney weierophinney mentioned this pull request Jan 4, 2018
@gsteel gsteel deleted the add-xml-response branch January 4, 2018 20:41
@Xerkus Xerkus added this to the 1.7.0 milestone Jan 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants