| Conditions | 3 |
| Total Lines | 14 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import typing |
||
| 37 | async def send_json(self, |
||
| 38 | data: typing.Any, *, |
||
| 39 | without_response: bool = False) -> typing.Tuple[typing.Any, typing.Optional[dict]]: |
||
| 40 | http_response = await self.session.post(self.url, json=data, **self.request_kwargs) |
||
| 41 | |||
| 42 | try: |
||
| 43 | json_response = await http_response.json() |
||
| 44 | except aiohttp.ContentTypeError as e: |
||
| 45 | raise errors.ParseError(utils.get_exc_message(e)) from e |
||
| 46 | |||
| 47 | if without_response: |
||
| 48 | return None, None |
||
| 49 | |||
| 50 | return json_response, {'http_response': http_response} |
||
| 51 |