Python requests.get()

时间:2015-08-02 08:06:40

标签: python web python-requests

response=requests.get(posturl,postData,headers)
print response.read()

我构建代码,调试器报告

TypeError: get() takes exactly 1 argument (3 given)

我该如何解决?

1 个答案:

答案 0 :(得分:0)

您需要使用response=requests.get(posturl, postData, headers) 来执行POST请求:

response.content

要获取内容,请使用response.text(如果需要字节字符串)或print response.content (如果需要unicode字符串):

var queryGroupLog = from log2 in lg2.AsEnumerable()
                    group log2 by log2.Field<string>("Phone") into groupPhone
                    select new 
                    {
                        Phone = groupPhone.Key,
                        Status = groupPhone.OrderBy(p => p.Field<string>("Status"))
                                           .LastOrDefault()
                    };