thanks,
i've tried it but I am not able to parse it:
I tried both:
pivotal = json.loads(r.content)

session.flash(pivotal['url'])
session.flash(pivotal[0].url)



On Tuesday, March 4, 2014 5:18:02 PM UTC+2, Jonathan Lundell wrote:
>
> On 4 Mar 2014, at 5:35 AM, Avi A <avia...@gmail.com <javascript:>> wrote:
>
> Hi,
> I'm getting on a controller a json response as expected, and I didn't find 
> a way how to parse it yet:
>
>
> json.loads(r.content) will convert it to a dict.
>
>
> r = requests.post(url, data=json.dumps(payload), headers=headers)
> r.content returns something like that:
> {
>   "owner_ids": [
>
>   ],
>   "labels": [
>     {
>       "id": 7864106,
>       "created_at": "2014-03-04T10:39:27Z",
>       "project_id": 941736,
>       "name": "label",
>       "kind": "label",
>       "updated_at": "2014-03-04T10:39:27Z"
>     }
>   ],
>   "current_state": "unscheduled",
>   "id": 66856110,
>   "created_at": "2014-03-04T13:31:33Z",
>   "story_type": "bug",
>   "project_id": 941736,
>   "name": "title",
>   "url": "http://www.pivotaltracker.com/story/show/66856110";,
>   "kind": "story",
>   "updated_at": "2014-03-04T13:31:33Z",
>   "requested_by_id": 735355,
>   "description": "story http://google.com/105";
> }
>
> Thanks.
>
>
> -- 
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> --- 
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to web2py+un...@googlegroups.com <javascript:>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to