AnsweredAssumed Answered

How to call a Web Service from Python with athentication

Question asked by jsn on Sep 18, 2019

Hello everyone,

 

I am able to call a  HTTP web service from Python using urllib, urllib2.

 

But now I need to add authentication adding the UserID and Password in order to call the another service.

 

This is the existing code:

 

import arcpy, urllib, urllib2,

url = r'https://wwww.example.com/GISAddress/Check.asmx/VerifyAddress'
values = {'myAddress' : '100 SW 10 street'}

data = urllib.urlencode(values)
req = urllib2.Request(url, data)
response = urllib2.urlopen(req)
the_page = response.read()
t = ET.fromstring(the_page)

 

Thank you

Outcomes