Passing the variables in the URL is a GET request. How is the API being 
called (e.g., from the browser, from a Python/web2py app, from another 
server-side technology)? Depending on the answer, there are different ways 
of making a POST request (e.g., from the browser, it could be via form 
submission or an Ajax POST request, possibly using jQuery).

Anthony

On Tuesday, May 29, 2012 2:35:07 PM UTC-4, Sanjeet Roy wrote:
>
> i am using the following controller can any one tell me how to pass the 
> value in URL to insert the data in database i am trying :
>
>
> http://127.0.0.1:8000/myapp/api/get_person/?owner=sanjeet&name=roy&info=bangalore
>
> it gives the invalid argument can anyone tell me how i pass the valid 
> argument to insert in database
>
>
>
> @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()
>

Reply via email to