[ckan-dev] datastore API ajax request not working. 409 conflict
Denis Zgonjanin
deniszgonjanin at gmail.com
Wed Oct 7 12:04:53 UTC 2015
Hi Mathew,
Try it without the jsonp:
$.ajax({
url: 'http://catalogue.data.gov.bc.ca/api/action/datastore_search',
data: data,
success: function(data) {
alert('Total results found: ' + data.result.total)
}
});
- Denis
On Tue, Oct 6, 2015 at 12:50 PM, Brown, Mathew GCPE:EX <
Mathew.Brown at gov.bc.ca> wrote:
> Yesterday I found I was unable to make ajax requests using the
> (javascript) datastore API. I checked on the demo site and a number of
> other ckan instances and found this to be the same everywhere. I'm not sure
> what the problem is, this feature was working a few days ago..
>
> Here is an example of a resource I'm trying to access:
>
> <!DOCTYPE html>
> <met charset="utf-8">
>
>
> <body>
> <script
> src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js
> "></script>
>
> <h1>test api</h1>
>
> <script>
>
> var data = {
> resource_id: '9ba355b1-8c5d-491a-b3e0-b0d45e6effb8', // the resource id
> limit: 5
> };
> $.ajax({
> url: 'http://catalogue.data.gov.bc.ca/api/action/datastore_search',
> data: data,
> dataType: 'jsonp',
> success: function(data) {
> alert('Total results found: ' + data.result.total)
> }
> });
>
>
> </script>
>
> Does anyone have any ideas why I'm getting a 409 on this?
>
> Note, if I make this request through the browser, there’s no problem
>
>
> http://catalogue.data.gov.bc.ca/api/action/datastore_search?resource_id=9ba355b1-8c5d-491a-b3e0-b0d45e6effb8
>
> Thanks!
>
>
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20151007/cbaa79d2/attachment-0003.html>
More information about the ckan-dev
mailing list