Restful in .net core

·

1 min read

image.png

To return success with no content use

return NoContent();

POST is used to create a resource so if the POST has a ID like POST authors/myid If the id exists it should return Conflict

return new StatusCodeResult(StatusCodes.Status409Conflict)

To create the location URL in the header use

return CreateAtRoute(parametesr);

Patch command tools.ietf.org/html/rfc6902