[ckan harvester] Add support for sending an API key

This commit is contained in:
Adrià Mercader 2011-11-21 17:29:10 +00:00
parent 0ab5c53b47
commit cfaba6e1e8
1 changed files with 3 additions and 0 deletions

View File

@ -36,6 +36,9 @@ class CKANHarvester(HarvesterBase):
) )
try: try:
api_key = self.config.get('api_key',None)
if api_key:
http_request.add_header('Authorization',api_key)
http_response = urllib2.urlopen(http_request) http_response = urllib2.urlopen(http_request)
return http_response.read() return http_response.read()