You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// return this, no processingreturnCharlatanResponse.raw(
body:'{"id": 12}', // already a string
headers: {'content-type':'application/json'},
statusCode:200,
);
// return this but process the bodyreturnCharlatanResponse(
// still a map to be converted automatically based on the incoming accept header// or defaulting to json
{'id':12},
statusCode:200,
);
// current behavior would still workreturn {'id':12};
the reason i'm curious about this approach is that it would be nice to have a way to dynamically decide on the status code in addition to the response body. e.g. sometimes you might wanna do a 422 and not a 200.
The text was updated successfully, but these errors were encountered:
i'm musing about something like this
the reason i'm curious about this approach is that it would be nice to have a way to dynamically decide on the status code in addition to the response body. e.g. sometimes you might wanna do a 422 and not a 200.
The text was updated successfully, but these errors were encountered: