Python urllib.response.getheaders方法在哪里?

Python urllib.response.getheaders方法在哪里?,python,Python,我找不到f.getheaders()方法,它实际上是urllib.response.getheaders()。文档中缺少urllib.response的详细信息,我无法从GitHub的源代码中获得更多信息。您看到了吗。你真的在尝试getheader还是getheader?你也看到了。你是在尝试getheader还是getheader?另请参见 with request.urlopen('url') as f: data = f.read() print('Status:', f.

我找不到
f.getheaders()
方法,它实际上是
urllib.response.getheaders()
。文档中缺少urllib.response的详细信息,我无法从GitHub的源代码中获得更多信息。

您看到了吗。你真的在尝试getheader还是getheader?你也看到了。你是在尝试getheader还是getheader?另请参见
with request.urlopen('url') as f:
    data = f.read()
    print('Status:', f.status, f.reason)
    for k, v in f.getheaders():
        print('%s: %s' % (k, v))
print('Data:', data.decode('utf-8'))