File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,27 @@ Nirum HTTP transport for Python
33
44This package provides an HTTP transport for nirum-python _.
55
6- .. _nirum-python : https://github.com/spoqa/nirum-python
6+ .. code-block :: python
7+
8+ from youtservice import YourService_Client
9+ from nirum_http import HttpTransport
10+
11+ transport = HttpTransport(' https://service-host/' )
12+ client = YourService_Client(transport)
13+
14+ Since ``HttpTransport `` utilizes requests _ library under the hood, it can take
15+ a `session object `_ as well:
716
17+ .. code-block :: python
18+
19+ from requests import Session
20+
21+ session = Session()
22+ session.auth = (' user' , ' password' )
23+ transport = HttpTransport(' https://service-host/' , session = session)
24+
25+ .. _nirum-python : https://github.com/spoqa/nirum-python
26+ .. _requests : http://python-requests.org/
27+ .. _session object : http://docs.python-requests.org/en/master/user/advanced/#session-objects
828
929.. include :: CHANGES.rst
You can’t perform that action at this time.
0 commit comments