[Pdns-users] 405 Method Not Allowed error returned from zone update HTTP PATCH method against JSON REST API
Jordan Rieger
jordan at webnames.ca
Mon Feb 2 23:26:57 UTC 2015
Hello.
I'm writing code to interface with the HTTP JSON REST API of a PowerDNS 3.4.1 authoritative server with a MySQL backend.
I'm submitting a request to modify the records on a zone using a PATCH method as specified at https://doc.powerdns.com/md/httpapi/api_spec/#url-serversserver95idzoneszone95id, and I'm getting back a "405 Method Not Allowed" response. I am able to successfully GET the pre-created example.com zone and POST (create) or DELETE my own test zone. It's only PATCH that's not working.
I tried increasing the server log level to 9 (the maximum), and I see my request in the log, but it only shows the request size and the fact that it caused a 405 error, which I already know.
It doesn't seem to matter what content the PATCH request actually contains, what zone I use, or even if the zone exists at all. It seems to just be the PATCH method itself causing the problem. This makes me think that it is a simple configuration problem on the server. Maybe the internal HTTP server component is rejecting PATCH requests by default?
Anyways, here is the request. This is attempting to delete all TXT records on example.com:
10.9.9.64:8081 /servers/localhost/zones/example.com PATCH {"rrsets":[{"name":"example.com","type":"TXT","changetype":"DELETE","records":[],"comments":[]}]}
Response: 405 Method Not Allowed
Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.powerdns.com/pipermail/pdns-users/attachments/20150202/a727979d/attachment.html>
More information about the Pdns-users
mailing list