wsgi.input is actually the request body, so it is the same as request.body.

Which version of TG and WebOb are you using? With WebOb 1.0.8 the PUT
parameters end in request.params and so TG is able to use them to
dispatch the request. I didn't try with other versions.

On Sat, Mar 17, 2012 at 5:11 PM, alonn <[email protected]> wrote:
> in stackoverflow it's stated that :
> http://stackoverflow.com/questions/4642423/handle-the-http-put-method-in-python-wsgi
> wsgi represnts put as environ['wsgi.input'] (or something like that)
> also not specific TG maybe that would help
>
> On Friday, March 16, 2012 6:05:39 PM UTC+2, Rotem Tamir wrote:
>>
>> Hi everyone,
>>
>> I'm using backbone.js on the front to build the user interface, and my
>> favorite framework on the backend, turbogears 2.1.
>>
>> I have a controller method for handling object updates by backbone.
>> Backbone sends object updates as PUT requests (following RESTful
>> conventions).  This is my handler:
>>
>>     @expose('json')
>>     def tasks(self,id=None,**kw):
>>         method = request.environ['REQUEST_METHOD']
>>
>>         if id:
>>             obj = DBSession.query(Task).filter_by(id=id).first()
>>         else:
>>             return dict()
>>
>>         if method=='PUT' and id:
>>             print "PUT"
>>             print kw
>>
>> Everything works fine, except "kw" is an empty dict.  I have tried
>> looking inside request.environ to find where I can find my params,
>> which are definatly being sent (I am monitoring my HTTP requests with
>> firebug.)
>>
>> I tried to read the RestfulControllers source for clues, but haven't
>> found any.
>>
>> Any clues?
>>
>> Thanks,
>>
>> Rotem Tamir
>
>
> On Friday, March 16, 2012 6:05:39 PM UTC+2, Rotem Tamir wrote:
>>
>> Hi everyone,
>>
>> I'm using backbone.js on the front to build the user interface, and my
>> favorite framework on the backend, turbogears 2.1.
>>
>> I have a controller method for handling object updates by backbone.
>> Backbone sends object updates as PUT requests (following RESTful
>> conventions).  This is my handler:
>>
>>     @expose('json')
>>     def tasks(self,id=None,**kw):
>>         method = request.environ['REQUEST_METHOD']
>>
>>         if id:
>>             obj = DBSession.query(Task).filter_by(id=id).first()
>>         else:
>>             return dict()
>>
>>         if method=='PUT' and id:
>>             print "PUT"
>>             print kw
>>
>> Everything works fine, except "kw" is an empty dict.  I have tried
>> looking inside request.environ to find where I can find my params,
>> which are definatly being sent (I am monitoring my HTTP requests with
>> firebug.)
>>
>> I tried to read the RestfulControllers source for clues, but haven't
>> found any.
>>
>> Any clues?
>>
>> Thanks,
>>
>> Rotem Tamir
>
> --
> You received this message because you are subscribed to the Google Groups
> "TurboGears" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/turbogears/-/BgpZGGdLSs4J.
>
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/turbogears?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en.

Reply via email to