[PDB Tech] pdb, PUT, python, fail - or maybe stupidity...
Elmar K. Bins
elmi at 4ever.de
Tue Jan 28 03:05:04 PST 2020
Hi gents, ladies,
Arnold asked me to post this to the list, maybe I'm just doing something very
wrong. If anybody has a hint (or experience), that could potentially make me
happy :-)
Elmar.
===
I'm trying to update a net object from python, using the requests library with
the peeringdb RESTful API, essentially doing a PUT operation..
Just in case I'm too stupid to ... here's the whole she-bang
---------- What I send:
import request
URL = 'https://isc-apiuser:********@peeringdb.com/api/net/12085'
dict_headers = {
"Accept" : "application/json",
"Content-Type" : "application/json",
}
dict_changes = {
"irr_as_set" : "AS3557",
}
request.put(url=URL, data=dict_changes, headers=dict_headers)
---------- What I get:
400 Client Error: Bad Request for url:
https://isc-apiuser:************@peeringdb.com/api/net/12085
===
Yes, the user has "update" rights to all net objects (got the 403 when that was
not the case, so auth works)
More information about the Pdb-tech
mailing list