CKAN GET vs. POST


#1

In an issue on the R CKAN client brought up at https://github.com/ropensci/ckanr/issues/67 , there’s discussion of GET vs. POST`` requests. Some CKAN instances block allPOSTrequests, so they'd like as many methods to useGET` as possible.

Some of the CKAN API allows GET (which we can allow in our R client for API methods that allow GET), but many AFAIK require POST. There is the trick of sending a POST with X-HTTP-Method-Override, but I’ve tried and that doesn’t seem to work, - it’s simply treated as a POST request, and is blocked on instances that block POST's

Any thoughts on this?

(sorry if this is the wrong place to post, let me know a better place)


#2

As far as I am aware, the only ones that require POST requests are request that are changing content. Given the size of the content, and that it’s JSON I can’t imagine allowing POST requests to be replicated via a GET would work.

Are there specific calls where you can only send POST but would expect for GET requests to work just as well?


#3

I seem to remember using all POST requests because the http client we use httr doesn’t allow body in GET requests, and I thought at least some of the CKAN API methods wanted a body to be sent even in a GET, but I could be remembering wrong. I’ll see about switching all methods that don’t change content to GET


#4

Yes, I think this used to be the case, you’re not mis-remembering, but it should be a lot better with /api/3/action/*