cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1657
Views
3
Helpful
4
Replies

HTTP API - authentication?

Dirk-Jan Uittenbogaard
Cisco Employee
Cisco Employee

When performing HTTP GET's to my SX10 I keep getting

<head>

        <title>401 Unauthorized</title>

    </head>

How can I authenticate in an HTTP GET request?

        (think about a Python application that needs information from 1 SX10)

1 Accepted Solution

Accepted Solutions

Dirk-Jan Uittenbogaard
Cisco Employee
Cisco Employee

Answer: basic authentication

DJ

View solution in original post

4 Replies 4

Dirk-Jan Uittenbogaard
Cisco Employee
Cisco Employee

Answer: basic authentication

DJ

Abdulsamet
Level 1
Level 1

Python3 code;

import requests

requests.packages.urllib3.disable_warnings()

sys_url = "https://10.1.1.34/getxml?location=/Status/SystemUnit"


r = requests.get(sys_url, auth=('admin', 'password'), verify=False)


print(r.text)

Thank you for sharing this example!

You're welcome

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: