Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ApiResponse] Allow ApiResponse to send custom HTTP status #12

Closed
wants to merge 3 commits into from

Conversation

daveblake
Copy link

I'd like to be able to send a custom HTTP response (E.g. 201 when creating a resource for a REST api).

I did consider putting the getStatusCode() method into the ApiResponseInterface but I imagine there are unknown classes inheriting this that would also need updating - so not backwards compatible.

It may be worth also updating Packaged\Api\Abstracts\AbstractApiResponse to include a getStatusCode() method with a default response of 200.

I'm happy to extend the class and override _processResponse() method but it seems quite restrictive to have this hard coded.

@bajb bajb closed this Dec 11, 2018
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.

None yet

2 participants