-
-
Notifications
You must be signed in to change notification settings - Fork 750
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
HTTP status codes #65
Comments
ah, now i see #38 for errors. is there a way to send non-error custom status codes? |
this may be something better handled by feathers as it is specific to RESTful HTTP. specifically i was thinking about 201 status and Location header on create and 204 status when response is empty. is this appropriate? |
This would be a good thing to add. Always looking for more ways to improve the REST provider. Although, you should be able to implement this functionality already using a custom middleware ( var app = feathers()
.use('/todos', todoService)
.use(function(req, res, next) {
if(_.isEmpty(req.data)) {
res.status = 204;
}
if(req.method === 'POST') {
res.status = 201;
}
next();
});
app.listen(8080); |
ah, awesome, thank you. |
I'm wondering if it should still send a 204 when the response is |
IMHO an empty object is still a response (just like an empty array). I would consider |
i agreed with @jgillich. |
Add ability to skip all following hooks
Add ability to skip all following hooks
…ting (#65) * Add namespace to enable `import * as from` syntax in TS * Add ? to options
…ting (#65) * Add namespace to enable `import * as from` syntax in TS * Add ? to options
Addng an update prompt when any generators are invoked
* chore(package): update sinon to version 6.0.0 * Update Travis install script
Removing assigning token to params.query for sockets. Closes #65.
* chore(package): update sinon to version 6.0.0 * Update Travis install script
Removing assigning token to params.query for sockets. Closes #65.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs. |
hi,
how does one send an HTTP status code other than 200, either on success or on error? i'm trying to follow HTTP API best practices, something similar to this.
cheers!
The text was updated successfully, but these errors were encountered: