Open fontebasso opened 6 years ago
Looks very good, thank you! :-)
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.
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! 👍
Close # 13
Adding
getResponse
method that returns a response object that implementsResponseInterface
from PSR-7I 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.