[ckan-dev] Subject: Re: problem inserting a row in the dataset

Dominik Moritz dominik.moritz at okfn.org
Sat Jun 1 08:45:38 UTC 2013


Hi fran,

GET and POST are two different concepts for sending data to a server. GET passes the parameters in the URL, which is very limited because certain strings have to be encoded and also the length of a URL is limited. This is why you should use POSt, where the data is sent in the message body, instead of the message HEAD. You should really read http://www.w3schools.com/tags/ref_httpmethods.asp which explains the difference. If you want to know, how to send a POST request form iOS, look at http://lmgtfy.com/?q=send+POST+iOS ;-)

I hope that you will be able to finish your project in time and would love if you could send a summary to the mailing list about your project.

Cheers,
Dominik

On 1 Jun 2013, at 02:20, fwolanczyk at cs.com wrote:

> 
> 
> hi dominik,
> i apologize for not knowing how to reply to the post - 
> there is not POST nor GET in the string, so i dont understand what you mean...
> fran w
> 
> 
> 
> Hi,
> 
> use POST, instead of GET[1] to write data to datastore_upsert.
> 
> Cheers,
> Dominik
> 
> [1] http://www.w3schools.com/tags/ref_httpmethods.asp
> 
> On 31 May 2013, at 18:35, fwolanczyk at cs.com wrote:
> 
>> 
>> 
>> hi there,
>> we tried to ask 
>> Gavin Chait | Head of Services | Open Knowledge Foundation
>> for  help, but were asked to post to the dev list - i hope someone can help - 
> we have a deadline for this NYC BigApps contest of june 7, so this is timely 
> critical!
>> 
>> 
>> i made a dataset, and i have no problem querying the set using this string (i 
> blocked out the id number)
>> 
>> 
>> 
>>   NSString *feedURLString = @"http://sandboxdw.pediacities.com/api/3/action/datastore_search?resource_id=XXX&limit=5";
>> 
>> 
>> 
>> 
>> 
>> i am getting "http error" (400) when i try to insert a row in it 
>> here is the url i use
>> 
>> 
>> 
>> http://sandboxdw.pediacities.com/api/3/action/datastore_upsert?resource_id=XXX&records=%7B%22Division%22:%20%22BMTFake%22,%20%22Line%22:%20%22BroadwayFake%22,%22Station_Name%22:%20%2249th%20St%22,%22Station_Latitude%22:%20%22BMTFake%22,%22Station_Longitude%22:%20%20%22-73.984139%22%7D&method=insert
>> 
>> 
>> 
>> i am only providing a few of the columns on the dataset - that cant be the 
> problem... it must be the syntax... i have spent hours researching this, to no 
> avail - any ideas??
>> thnx,
>> fran
>> 
> 
> 
> 

Dominik Moritz
CKAN developer  |  skype: d.moritz  |  @doobly_doo
The Open Knowledge Foundation
Empowering through Open Knowledge
http://okfn.org/  |  @okfn  |  http://ckan.org  |  @CKANproject





More information about the ckan-dev mailing list