> Thanks > Zane > -- > You received this message because you are subscribed to the Google > Groups "pylons-devel" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/pylons-devel/-/D5fWCOMEDOYJ. > To post to this group, send email to pylons-devel@googlegroups.com. > To unsubscribe from this group, send email to pylons-devel > +unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/pylons-devel?hl=en.
Yes.This is what I want, but now I receive a string "{'succeed':True}", and before I add header in response is a object {'succeed':True} ( I using Ajax) I guess this cause the view_config(renderer='json')
But How can I add header and return a Obj not a string.
On Mon, 2012-02-20 at 07:34 -0800, Zane wrote: > Thanks @Chris
> Yes.This is what I want, but now I receive a string > "{'succeed':True}", and before I add header in response is a object > {'succeed':True} ( I using Ajax) > I guess this cause the view_config(renderer='json')
> But How can I add header and return a Obj not a string.
> -- > You received this message because you are subscribed to the Google > Groups "pylons-devel" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/pylons-devel/-/IxdaCNua2XYJ. > To post to this group, send email to pylons-devel@googlegroups.com. > To unsubscribe from this group, send email to pylons-devel > +unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/pylons-devel?hl=en.
request.response.headers = headers # It would lost the Content-Type:application/json here # so when I add header like this way, it will return a string. return {'succeed':True}
And before I replace the header, the render='json' will help me to add the Content-Type.
> request.response.headers = headers > # It would lost the Content-Type:application/json here > # so when I add header like this way, it will return a string. > return {'succeed':True}
> And before I replace the header, the render='json' will help me to add > the Content-Type.
> To post to this group, send email to pylons-devel@googlegroups.com. > To unsubscribe from this group, send email to > pylons-devel+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/pylons-devel?hl=en.
> To post to this group, send email to pylons-devel@googlegroups.com. > To unsubscribe from this group, send email to > pylons-devel+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/pylons-devel?hl=en.