You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 13, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: CONTRIBUTING.rst
+1-1
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ We're pretty open about how people contribute to PyOTA, but there are a few thin
29
29
- Please do not post support requests here. Use the ``#python`` channel on `Discord`_
30
30
- Please do not propose new API methods here. There are multiple IOTA API libraries out there, and they must all have the same functionality.
31
31
32
-
- That said, if you have an idea for a new API method, please share it on the ``#developers`` channel in `Discord`_ so that IOTA Foundation members can evaluate it!
32
+
- That said, if you have an idea for a new API method, please share it on the ``#clients-discussion`` channel in `Discord`_ so that IOTA Foundation members can evaluate it!
api = Iota('https://service.iotasupport.com:14265')
45
-
api = Iota(HttpAdapter('https://service.iotasupport.com:14265'))
63
+
api = Iota('https://nodes.thetangle.org:443')
64
+
api = Iota(HttpAdapter('https://nodes.thetangle.org:443'))
46
65
47
66
# Use HTTPS with basic authentication and 60 seconds timeout:
48
67
api = Iota(
49
68
HttpAdapter(
50
-
'https://service.iotasupport.com:14265',
69
+
'https://nodes.thetangle.org:443',
51
70
authentication=('myusername', 'mypassword'),
52
71
timeout=60))
53
72
54
-
``HttpAdapter`` uses the HTTP protocol to send requests to the node.
73
+
.. autoclass:: HttpAdapter
55
74
56
-
To configure an ``Iota`` instance to use ``HttpAdapter``, specify an
57
-
``http://`` or ``https://`` URI, or provide an ``HttpAdapter`` instance.
75
+
To configure an :py:class:`Iota` instance to use :py:class:`HttpAdapter`,
76
+
specify an ``http://`` or ``https://`` URI, or provide an
77
+
:py:class:`HttpAdapter` instance.
58
78
59
-
The ``HttpAdapter`` raises a ``BadApiResponse`` exception if the server
79
+
The :py:class:`HttpAdapter` raises a ``BadApiResponse`` exception if the server
60
80
sends back an error response (due to invalid request parameters, for
61
81
example).
62
82
63
83
Debugging HTTP Requests
64
84
^^^^^^^^^^^^^^^^^^^^^^^
65
-
66
-
.. code:: python
67
-
68
-
from logging import getLogger
69
-
70
-
from iota import Iota
71
-
72
-
api = Iota('http://localhost:14265')
73
-
api.adapter.set_logger(getLogger(__name__))
74
-
75
85
To see all HTTP requests and responses as they happen, attach a
76
86
``logging.Logger`` instance to the adapter via its ``set_logger``
77
87
method.
78
88
79
-
Any time the ``HttpAdapter`` sends a request or receives a response, it
89
+
Any time the :py:class:`HttpAdapter` sends a request or receives a response, it
80
90
will first generate a log message. Note: if the response is an error
81
-
response (e.g., due to invalid request parameters), the ``HttpAdapter``
91
+
response (e.g., due to invalid request parameters), the :py:class:`HttpAdapter`
82
92
will log the request before raising ``BadApiResponse``.
83
93
84
94
.. note::
85
95
86
-
``HttpAdapter`` generates log messages with ``DEBUG`` level, so make sure that your logger's ``level`` attribute is set low enough that it doesn't filter these messages!
96
+
:py:class:`HttpAdapter` generates log messages with ``DEBUG`` level, so make
97
+
sure that your logger's ``level`` attribute is set low enough that it
0 commit comments