Extreme API with Python
Table Of Contents
- 1 Preface
- 2 Introduction
- 3 EXOS APIs
- 4 VOSS API
- 5 XMC API
- 6 ExtremeCloud IQ API
- 7 Extreme Campus Controller API
Extreme API with Python
Page | 23
Part no.9036931-00 Rev AA February 2021
https://httpbin.org/get?h2g2=42&elite=1337
200
application/json
None
{
"args": {
"elite": "1337",
"h2g2": "42"
},
"headers": {
"Accept": "*/*",
"Accept-Encoding": "gzip, deflate",
"Host": "httpbin.org",
"User-Agent": "python-requests/2.22.0",
"X-Amzn-Trace-Id": "Root=1-5ed8c610-484d6854daf7112485a3b020"
},
"origin": "109.13.132.180",
"url": "https://httpbin.org/get?h2g2=42&elite=1337"
}
<class 'dict'>
{'args': {'elite': '1337', 'h2g2': '42'}, 'headers': {'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate', 'Host': 'httpbin.org', 'User-Agent':
'python-requests/2.22.0', 'X-Amzn-Trace-Id': 'Root=1-5ed8c610-
484d6854daf7112485a3b020'}, 'origin': '109.13.132.180', 'url':
'https://httpbin.org/get?h2g2=42&elite=1337'}
Next, send data to the service by using the POST method
from requests and changing the path to the
service to POST. Because you are now sending data to the service, you must remove the params
keyword and replace it with the data keyword, as shown below:
import requests
payload = {"h2g2": 42, "elite": 1337}
r = requests.post('HTTPS://httpbin.org/post', data=payload)
print(r.url)
print(r.status_code)
print(r.headers['content-type'])
print(r.text)
data = r.json()










