OLD | NEW |
---|---|
1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """ | 5 """ |
6 A http client with support for https connections with certificate verification. | 6 A http client with support for https connections with certificate verification. |
7 | 7 |
8 The verification is based on http://tools.ietf.org/html/rfc6125#section-6.4.3 | 8 The verification is based on http://tools.ietf.org/html/rfc6125#section-6.4.3 |
9 and the code is from Lib/ssl.py in python3: | 9 and the code is from Lib/ssl.py in python3: |
10 http://hg.python.org/cpython/file/4dac45f88d45/Lib/ssl.py | 10 http://hg.python.org/cpython/file/4dac45f88d45/Lib/ssl.py |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 return status_code, content | 221 return status_code, content |
222 | 222 |
223 | 223 |
224 class HttpClientLocal(http_client.HttpClient): | 224 class HttpClientLocal(http_client.HttpClient): |
225 """This http client is used locally in a workstation, GCE VMs, etc.""" | 225 """This http client is used locally in a workstation, GCE VMs, etc.""" |
226 | 226 |
227 @staticmethod | 227 @staticmethod |
228 def Get(url, params={}, timeout=None): | 228 def Get(url, params={}, timeout=None): |
229 if params: | 229 if params: |
230 url = '%s?%s' % (url, urllib.urlencode(params)) | 230 url = '%s?%s' % (url, urllib.urlencode(params)) |
231 return _SendRequest(url, timeout=timeout) | 231 print 'requesting url: %s' % url |
stgao
2014/08/29 22:47:36
I will revert this before committing.
I'm running
| |
232 status_code, content = _SendRequest(url, timeout=timeout) | |
233 return status_code, content | |
OLD | NEW |