Added HTTP Status codes from the RFCs 4918 and 7538#654
Conversation
|
Hi @0xdeafcafe, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! TTYL, DNFBOT; |
|
Nice. Submitted 308 for Kestrel as well; aspnet/KestrelHttpServer#925 |
|
308 should be fine. Are you actually using WebDAV? Or are you just adding them for completeness? |
|
I'm using the I just added the entire RFC while I was at it for completeness sake. Currently I'm doing this, which I'd rather not (I know I could just extend StatusCodes myself, but I thought I'd just do a pull request instead): if (!ModelState.IsValid)
return Json(422 /* unprocessable_entity */, ModelState.ToDictionary());
var question = _lawsContext.Questions.FirstOrDefault(q => q.Id == questionId);
if (question == null)
return Json(StatusCodes.Status404NotFound, new Error<object>("question_not_found"));
// Verify Module Id is real
var scope = _lawsContext.Scopes.FirstOrDefault(r => r.Id == (Guid) model.ScopeId);
if (scope == null)
return Json(422 /* unprocessable_entity */, new Error<object>("scope_not_found")); |
|
|
|
Rebased and merged. Thanks. |
|
It would be also nice to have an |
These two RFCs are finalized, and rather useful that I feel we should have in the core framework.
7538 RFC Spec
4918 RFC Spec