Skip to content
Myr

Merge branch 'fix-merge-setting' of https://github.com/ak1r4/requests into proposed/2.8.0

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Cory Benfield · committed by Cory Benfield · parents 873f834, 276202f · Browse files · 4 files+14 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+14 added−10 removed

  • other:+14 added−10 removed

4 files+14 added−10 removed

modified:docs/community/faq.rst+3 added-3 removed
77 unmodified lines
78when servers are using `Virtual Hosting`_. When such servers are hosting79more than one SSL site they need to be able to return the appropriate80certificate based on the hostname the client is connecting to.8182Python3's SSL module includes native support for SNI. This support has not been83back ported to Python2. For information on using SNI with Requests on Python284refer to this `Stack Overflow answer`_.82Python3 and Python 2.7.9+ include native support for SNI in their SSL modules.83For information on using SNI with Requests on Python < 2.7.9 refer to this84`Stack Overflow answer`_.8586.. _`Server-Name-Indication`: https://en.wikipedia.org/wiki/Server_Name_Indication87.. _`virtual hosting`: https://en.wikipedia.org/wiki/Virtual_hosting88.. _`Stack Overflow answer`: https://stackoverflow.com/questions/18578439/using-requests-with-tls-doesnt-give-sni-support/18579484#18579484
modified:docs/user/quickstart.rst+3 added-4 removed
71 unmodified lines
7273Note that any dictionary key whose value is ``None`` will not be added to the74URL's query string.7576In order to pass a list of items as a value you must mark the key as77referring to a list like string by appending ``[]`` to the key::76You can also pass a list of items as a value::7779 >>> payload = {'key1': 'value1', 'key2[]': ['value2', 'value3']}78 >>> payload = {'key1': 'value1', 'key2': ['value2', 'value3']}79 >>> r = requests.get("http://httpbin.org/get", params=payload)80 >>> print(r.url)82 http://httpbin.org/get?key1=value1&key2%5B%5D=value2&key2%5B%5D=value381 http://httpbin.org/get?key1=value1&key2=value2&key2=value38283Response Content84----------------85
386 unmodified lines
modified:requests/sessions.py+1 added-3 removed
61 unmodified lines
62 merged_setting = dict_class(to_key_val_list(session_setting))63 merged_setting.update(to_key_val_list(request_setting))6465 # Remove keys that are set to None.66 for (k, v) in request_setting.items():66 for (k, v) in merged_setting.items():67 if v is None:68 del merged_setting[k]6970 merged_setting = dict((k, v) for (k, v) in merged_setting.items() if v is not None)7170 return merged_setting717273def merge_hooks(request_hooks, session_hooks, dict_class=OrderedDict):
602 unmodified lines
modified:test_requests.py+7 added
128 unmodified lines
129 request = requests.Request('GET',130 "http://example.com/path?key=value#fragment", params={"a": "b"}).prepare()131 assert request.url == "http://example.com/path?key=value&a=b#fragment"132133 def test_params_original_order_is_preserved_by_default(self):134 param_ordered_dict = collections.OrderedDict((('z', 1), ('a', 1), ('k', 1), ('d', 1)))135 session = requests.Session()136 request = requests.Request('GET', 'http://example.com/', params=param_ordered_dict)137 prep = session.prepare_request(request)138 assert prep.url == 'http://example.com/?z=1&a=1&k=1&d=1'139140 def test_mixed_case_scheme_acceptable(self):141 s = requests.Session()142 s.proxies = getproxies()143 parts = urlparse(httpbin('get'))
1553 unmodified lines