Is there a way to get errors or debug when update my resources to CKAN using API.??
After create it using the next link: Update resource in CKAN using python
Everything works great except the file is not updated correctly. Description, name, etc.. works great and the time of the dataset is correctly updated, but not the file.
This is the code I'm using against demo.ckan.org:
resource_dict_excel = {'id': '07153b0a-f330-4235-b28a-21bdfe8ff9ca',
'url':'http://myserver/ckan_api/public_html/test-excel.xls',
'format':'XLS',
'description':'Descripción excel'}
requests.post('http://demo.ckan.org/api/3/action/resource_update',
json=resource_dict_excel,
headers={"Authorization": "b2367ca2-567c-46b4-b714-67632ef906d5"})
print resource_dict_excel
UPDATE
url="http://myserver/ckan_api/public_html/producction.xls"
f = urllib2.urlopen(url)
data = f.read()
requests.post('http://myckanserver/api/3/action/resource_update',
data={"package_id":"90bc25e0-be1d-49a4-8e3a-c43d945bb9c1"},
headers={"X-CKAN-API-Key": "2b367c89-924d-4086-8d76-1e6672bb0c23"},
files=[('upload', data)])
Works correct!!!
Thanks