将curl转换为python urllib2

时间:2010-08-18 20:10:00

标签: python curl urllib2 libcurl urllib

有人可以告诉我如何使用python urllib2

将此curl调用转换为调用
curl -X POST
-H "Content-Type:application/json"
-d "{\"data\":{}}"
-H "Authorization: GoogleLogin
auth=0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789...XYZ"
https://www.googleapis.com/prediction/v1/training?data=${mybucket}%2F${mydata}

1 个答案:

答案 0 :(得分:1)