79593684

Date: 2025-04-26 07:43:46
Score: 1
Natty:
Report link

Regarding third question (REST compliance):

  1. You should use PUT for your case. PATCH is usually used for partial updates.
  2. "api/TeacherPage/UpdateTeacher" isn't a RESTful API. Latter suppose APIs which represent hierarchical resources with CRUD operations on them (plus HATEOAS, but it's a hard point and omitted frequently). CRUD operations implements not through hierarchy (path/URI) but through HTTP method. So, for REST compliance you should have something like "/api/Teachers/{some-kind-of-id}". Then GET this URI for view teacher's page or PUT for update. Adding new one should be implemented through POST the same teacher object to "/api/Teachers" URI.
Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Elliot