[ckan-dev] Upload using resource_create via API

Marcelo Rezende malvre at gmail.com
Fri Jan 24 17:14:59 UTC 2014


I can't do that... request with multipart must pass parameters one by one
with -F argument. passing parameters with -d works, but without upload,
just for register a URL




2014/1/24 Ross Jones <ross at servercode.co.uk>

> Hi,
>
> I think the package_id has to be passed as json in the body for create,
> try the following (where I’ve replaced -F package_id=:
>
> curl http://dados.rs.gov.br/api/action/resource_create -H
> "Authorization:<my auth key>" -F upload=@/Users/rezende/Desktop/menu.json
> -d '{"package_id":"testeopendata6”}'
>
> This is based on the example in the docs that uses resource_create.  I
> think resource_update allows the resource_id as a form parameter.
>
> Ross
>
>
> On 24 Jan 2014, at 16:19, Marcelo Rezende <malvre at gmail.com> wrote:
>
> I'm trying to create a resource uploading a file via API, but return JSON
> decoding error. CKAN version is 2.2a
>
> my command line:
>
> curl http://dados.rs.gov.br/api/action/resource_create -H
> "Authorization:<my auth key>" -F upload=@/Users/rezende/Desktop/menu.json
> -F package_id=testeopendata6
>
>
> I did as the doc:
> http://docs.ckan.org/en/latest/filestore.html?highlight=upload#filestore-api
>
> anyone else had this problem?
>
> --
>
> Marcelo Rezende
> malvre at gmail.com
> http://malvre.com
>
>  _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>


-- 

Marcelo Rezende
malvre at gmail.com
http://malvre.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140124/af158279/attachment-0003.html>


More information about the ckan-dev mailing list