diff options
author | Jose M. Guisado <jguisado@soleta.eu> | 2023-10-10 17:24:44 +0200 |
---|---|---|
committer | Jose M. Guisado <jguisado@soleta.eu> | 2023-10-11 10:28:22 +0200 |
commit | 4fca62a8ee24524b65d6b4526e0f8e3397b7e797 (patch) | |
tree | 0b4e65ecf0cf6f21295c496d0a38d021ee3b4160 /sources/client.c | |
parent | 6f6372d0e0c19530364b168fb9c843c45a430c5a (diff) |
rest: extend /repository/addv1.2.5
POST /repository/add checks validity of the repository ip address
specified in the request payload.
/repository/add can optionally receive a center id parameter inside its
request payload. For backward compatibility, the default center id (1)
is used if no center is received inside the request payload.
POST /repository/add returns a JSON response payload containing relevant
fields from the inserted repository.
$ curl -D-
\ -X POST
\ -H "Authorization: a0e9ab768cbe93dab5b1998e952bcdb7"
\ --json '{"name": "helloworld", "ip": "192.168.21.21a", "center": 2}'
\ localhost:8888/repository/add
HTTP/1.1 400 Bad Request
Content-Length: 0
$ curl -D-
\ -X POST
\ -H "Authorization: a0e9ab768cbe93dab5b1998e952bcdb7"
\ --json '{"name": "helloworld", "ip": "192.168.21.21a", "center": 2}'
\ localhost:8888/repository/add
HTTP/1.1 200 OK
Content-Length: 54
{"id": 7, "ip": "192.168.21.21", "name": "helloworld"}
Diffstat (limited to 'sources/client.c')
0 files changed, 0 insertions, 0 deletions