Skip to content

Adding method that returns PSR-7 response object#15

Closed
fontebasso wants to merge 2 commits intovarsitynewsnetwork:masterfrom
fontebasso:feature/headers_response
Closed

Adding method that returns PSR-7 response object#15
fontebasso wants to merge 2 commits intovarsitynewsnetwork:masterfrom
fontebasso:feature/headers_response

Conversation

@fontebasso
Copy link

Close # 13

Adding getResponse method that returns a response object that implements ResponseInterface from PSR-7

I have not modified the get method of AbstractWpEndpoint at: https://github.com/varsitynewsnetwork/wordpress-rest-api-client/blob/master/src/Endpoint/AbstractWpEndpoint.php#L46-L49 with the intention of preserving the compatibility as described by @te-online.

@te-online
Copy link

Looks very good, thank you! :-)

@boboudreau
Copy link
Member

Thanks @fontebasso! There's a lot of duplicated code here, and I'm not sure it's a requirement that the response type be application/json for a client to want to get the full PSR7 Response object, so I may take this PR and update it a bit before merging it.

@andyvanee
Copy link

I've taken a different route to solving the same issue in my PR. I needed this feature for pagination purposes, but I wanted to have the original request available as well for generating next/previous links. Anyway, I think this would be a nice feature to have either way! 👍

@mysyfy
Copy link

mysyfy commented Jun 21, 2019

For review: #26

@fontebasso
Copy link
Author

Closing this PR as it’s been open for over 7 years and I no longer believe it’s relevant to the project. Thank you for the opportunity to contribute.

@fontebasso fontebasso closed this May 1, 2025
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.

5 participants