If you want to make a POST request<http://en.wikipedia.org/wiki/POST_(HTTP)>, you need some way to send the post data from a client. The client could be a browser, in which case you can send post data by submitting a form or by sending an Ajax POST request. The client could be another server, in which case, you can use something like urllib2.urlopen() in Python ( http://docs.python.org/library/urllib2.html) or the Linux curl command-line utility (http://www.yilmazhuseyin.com/blog/dev/curl-tutorial-examples-usage/). You cannot make a POST request by simply visiting a URL in a browser -- that will only result in a GET request.
What exactly are you trying to do? How are you intending to make requests to this API? Anthony On Tuesday, May 29, 2012 10:29:06 PM UTC-4, Sanjeet Roy wrote: > > 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. > >

