(self, uri)
| 117 | self.log.info(self._last_json) |
| 118 | |
| 119 | def get(self, uri): |
| 120 | from urllib.parse import unquote |
| 121 | |
| 122 | uri = unquote(uri, errors="strict") |
| 123 | with requests.Session() as session: |
| 124 | resp = session.get( |
| 125 | self.server_addr + uri, |
| 126 | headers={"Connection": "close"}, |
| 127 | timeout=2, |
| 128 | ) |
| 129 | try: |
| 130 | self._last_resp = resp |
| 131 | self._last_json = resp.json() |
| 132 | except Exception: |
| 133 | return |
| 134 | else: |
| 135 | return self._last_json |
| 136 | |
| 137 | def post(self, uri, data=None): |
| 138 | from urllib.parse import unquote |
no outgoing calls