ckan / ckanapi

A command line interface and Python module for accessing the CKAN Action API
Other
176 stars 74 forks source link

CKAN API : Upload url link instead of files #125

Closed LekanAnni closed 6 years ago

LekanAnni commented 6 years ago

Hi,

I developed this API to upload to my CKAN instance which works fine. However , i had like to upload url link and not file but i dont seem to get it working.

`r = requests.post('http://mysite/api/action/resource_create',

                              data={'package_id': package['id'],
                                    'name': resource_name,
                                    'description':description,
                                    'format': extension,
                                    'url': 'upload',  # Needed to pass validation
                                    },
                              headers={'Authorization': APIKEY},
                              files = {'upload': (filename, 'http://mysite/file.pdf' )})`

Please kindly help me figure it out. Thanks

wardi commented 6 years ago

duplicate of https://github.com/ckan/ckan/issues/3820, and not related to this repo