I can send a POST request to /modalities/foo
(with a JSON body containing the AET and host/port), which will create a foo
modality. I found out that similar functionality is not available with peers.
$ http http://localhost:8028/peers/foo Url="http://localhost:8029"
HTTP/1.1 405 Method Not Allowed
Allow: GET,PUT,DELETE
Connection: keep-alive
Content-Length: 0
Keep-Alive: timeout=1
I get a 405 regardless of the OrthancPeersInDatabase
configuration option. Is this behavior intentional?
jodogne
January 18, 2021, 10:33am
2
You have to use the PUT method on “/modalities/foo” and “/peers/bar” in order to create/update respectively a modality or a peer (not POST).
Check out the OpenAPI documentation:
https://api.orthanc-server.com/#tag/Networking/paths/~1modalities~1{id}/put
https://api.orthanc-server.com/#tag/Networking/paths/~1peers~1{id}/put
Sébastien-
Ouch! I am stupid! Of course it’s a PUT, I even have it in my code https://github.com/Ch00k/orthanc-rs/blob/master/src/client.rs#L626
I am sorry for the fuss.