Tag Info

New answers tagged


Thanks, alexgleith! The problem in my simple code is: authKey = 'admin:geoserver' request = urllib2.Request(url, json.dumps(params), headers) should be replaced as: authKey = base64.encodestring('%s:%s' % (un, pw)).replace('\n', '') request = urllib2.Request(url) for k in headers.keys(): request.add_header(k, headers[k])


I have a REST example that works on GWC, so I'll set it up so it's shared: https://gist.github.com/alexgleith/c39c3f520102c30e4dec Here's the meaty bits: url = baseURL + layer + '.json' request = urllib2.Request(url) base64string = base64.encodestring('%s:%s' % (un, pw)).replace('\n', '') request.add_header("Authorization", "Basic %s" % base64string) ...

Top 50 recent answers are included