polonoko
polonoko

Reputation: 90

CKAN Upload File to Dataset via Postman (Manual HTTP Requests)

I'm trying to upload a file into a CKAN dataset using the API's. I eventually want to do that via .NET. For the moment, to understand how I want the request to look like, I am using Postman to simulate.

So far I am unable to get it to work correctly. Can anyone please guide me on how the request should look like?

As I understood from the API guide, it should look like this: Postman CKAN request

However this give the error message displayed in the screenshot: "Bad request - JSON Error: Invalid request. Please use POST method for your request". The dataset with that name already exists. The provided API key is correct and used successfully in another request (creating the dataset).

Obviously the request type is already POST.

I'm not sure what's wrong. Can someone advise please?

Thanks.

Upvotes: 2

Views: 753

Answers (2)

jspinella
jspinella

Reputation: 2423

I'm getting the same error with organization_create using CKAN 2.8.2.

Same exact request in Postman (and the request in a program I wrote) work fine in another CKAN instance running 2.8.3.

It sort of sounds like they fixed this in 2.8.3 but I can't say since the public CKAN changelog only goes to 2.8.2.

Upvotes: 0

Tarun Lalwani
Tarun Lalwani

Reputation: 146560

Remove the trailing / from the url, that may be causing a redirect to a GET without trailing / and hence the error about using POST method

Upvotes: 3

Related Questions