Closed ross-alexander closed 4 years ago
Please revise your bug report so that it entails only a raw curl request and its response. Wrap CLI commands and output in triple backticks (```) so that they are legible.
In addition to @jeremystretch's comment, this is not reproducible on master:
[root@miyu ~]# curl -X POST "https://master.netbox.dansheps.com/api/ipam/prefixes/" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token XXX" -d '{ "prefix": "10.4.0.0/16", "status": "container"}'
{"id":22,"family":{"value":4,"label":"IPv4"},"prefix":"10.4.0.0/16","site":null,"vrf":null,"tenant":null,"vlan":null,"status":{"value":"container","label":"Container","id":0},"role":null,"is_pool":false,"description":"","tags":[],"created":"2020-02-27","last_updated":"2020-02-27T13:55:53.379230Z"}
[root@miyu ~]#
Apologies and many thanks. The issue was I was missing the Content-type: application/json header. Once I had added that to the curl it worked on 2.7.8 with python 3.6.8 (Centos 8.1).
Many thanks for the quick response and again apologies for the my error.
Environment
Steps to Reproduce
Expected Behavior
Create new prefix (from the API documentation only the field "prefix" is required.
Observed Behavior
{"prefix":["This field is required."]}
I have a separate 2.7.8 with python 3.8.1 I get the following debug.