Skip to content
This repository was archived by the owner on Aug 3, 2020. It is now read-only.

LocationController: POST

Philipp Heim edited this page Jun 4, 2020 · 2 revisions

Für einen POST-Request übergibt man der API ID für die Adresse. Beispiel für das erstellen eines Produktes (POST: /api/product):

Payload des POST-Requests:

{
   "name": "Filiale test",
   "address": {
      "id": 1
   }
}

Bei erfolgreichem Request sendet der Server folgenden Response:

HTTP: 201 Created

Response Body:

{
 "id": 9,
 "name": "Filiale test",
 "addressId": 1
}

Response Header:

Unter location kann die erstellte Ressource abgefragt werden.

content-length: 44
content-type: application/json; charset=utf-8
date: Sun, 31 May 2020 17:16:20 GMT
location: https://localhost:5001/api/location/9
server: Kestrel

Clone this wiki locally