I know the list mangles URLs 😊. I actually had an similar issue with this because an internal proxy (that I was not aware of) did something similar to this to my request, and when I went to a DMZ issue cleared up. Apologies, not enough coffee this morning. -----Original Message----- From: Pdb-tech <pdb-tech-bounces@lists.peeringdb.com> On Behalf Of Elmar K. Bins Sent: 28 January 2020 11:22 To: pdb-tech@lists.peeringdb.com Subject: Re: [PDB Tech] pdb, PUT, python, fail - or maybe stupidity... Hi Mike, mike.simkins@sungardas.com (Mike Simkins) wrote:
It is probably just because it is redirecting through proofpoint, which mangles the URL with junk, change your URL to just be
URL = 'https://urldefense.proofpoint.com/v2/url?u=https-3A__api-2Duser.......-40pee... '
That's of course what the URL looks like. URL mangling in mailing lists... what has the world come to? Elmar.
-----Original Message----- From: Pdb-tech <pdb-tech-bounces@lists.peeringdb.com> On Behalf Of Elmar K. Bins Sent: 28 January 2020 11:05 To: pdb-tech@lists.peeringdb.com Subject: [PDB Tech] pdb, PUT, python, fail - or maybe stupidity...
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://urldefense.proofpoint.com/v2/url?u=https-3A__isc-2Dapiuser-3A-2A-2A-... '
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://urldefense.proofpoint.com/v2/url?u=https-3A__isc-2Dapiuser-3A- 2A-2A-2A-2A-2A-2A-2A-2A-2A-2A-2A-2A-40peeringdb.com_api_net_12085&d=Dw IGaQ&c=gYbc-GKV5BQa9zrq1GFCVg&r=S1PZn0PYDDYtiCW2fix2C1ZHo8KzLAckyehxqI 4wl20&m=Bj5gpSKHmwyokLiDwTrX0jXf9zpTc2-BOA0tVEB24-I&s=Y34j7X3mWgmw72Iy pQKJtOk-oN-Zwlz-GnIqByXPMbc&e=
_______________________________________________ Pdb-tech mailing list Pdb-tech@lists.peeringdb.com https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.peeringdb.com_cgi...