Closed zkwbbr closed 4 years ago
Yeah, just return a response object, being able to return an array is just convenience
Sent from ProtonMail mobile
-------- Original Message -------- On 1 Feb 2020, 20:27, zkwbbr wrote:
According to the JSON Strategy doc, we can
return an array or object, and a JSON response will be built for you.
This is convenient but when using this, is it possible to set the HTTP status code without the need to manually build/return an ResponseInterface response?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.
@philipobenito Alright so basically the array
return convenience method is there for GET
methods with 200
status only. Anything else must be done the usual way with a proper ResponseInterface
object.
Correct, yes. What I tend to do is build a response factory that can create the different responses I need with hypermedia etc when required.
Sent from ProtonMail mobile
-------- Original Message -------- On 2 Feb 2020, 06:20, zkwbbr wrote:
@philipobenito Alright so basically the array return convenience method is there for GET methods with 200 status only. Anything else must be done the usual way with a proper ResponseInterface object.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@philipobenito Got it thanks!
According to the JSON Strategy doc, we can
This is convenient but when using this, is it possible to set the HTTP status code without the need to manually build/return an
ResponseInterface
response?