Hi Anthony actually i didn't get you i want ipost the data something like
that which are given in the following link :-

http://www.mail-archive.com/[email protected]/msg70275.html

http://vimeo.com/21133657

http://www.reddit.com/r/programming/comments/g5hxq/web2py_trunk_has_a_new_restful_api_that_writes_db/c1l2ykg


On Wed, May 30, 2012 at 1:09 AM, Anthony <[email protected]> wrote:

> You could submit the post request via a form on the page, with the form's
> action set to the get_person URL, or you could submit via Ajax, possibly
> using jQuery.post() (see http://api.jquery.com/jQuery.post/).
>
> Anthony
>
>
> On Tuesday, May 29, 2012 3:01:09 PM UTC-4, Sanjeet Roy wrote:
>>
>> Hii Anthony i have the following in my db:-
>>
>> db.define_table('person',**Field('name'),Field('**birthdate','date'))
>> db.define_table('dog',Field('**name'),Field('owner',db.**
>> person),Field('info','text'))
>>
>> and api.py is my controller :-
>>
>> @request.restful()
>> def get_person():
>>     def GET(id):
>>         person = db.person(id)
>>         return person.as_dict() if person else None
>>     def POST(owner,name,info):
>>         return db.dog.validate_and_insert(**owner=owner,name=name,info=**
>> info)
>>     return locals()
>>
>
How can i post and insert the data in to the table dog which are given
above .

like that :-

 curl -i -d 
"info=aInfo&name=aName&owner=74"http://localhost:8000/restful/api/manage_dog

which are given in the above link.

Reply via email to