Fix: NameError: name 'json' is not defined
Some checks failed
Test / Builder (push) Failing after 35s
Some checks failed
Test / Builder (push) Failing after 35s
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
__author__ = 'RemiZOffAlex'
|
__author__ = 'RemiZOffAlex'
|
||||||
__email__ = 'remizoffalex@mail.ru'
|
__email__ = 'remizoffalex@mail.ru'
|
||||||
|
|
||||||
|
import json
|
||||||
import jinja2
|
import jinja2
|
||||||
import logging
|
import logging
|
||||||
import pathlib
|
import pathlib
|
||||||
@@ -38,8 +39,14 @@ class APIHandler:
|
|||||||
|
|
||||||
async def post(self, request) -> Response:
|
async def post(self, request) -> Response:
|
||||||
try:
|
try:
|
||||||
|
if self.debug:
|
||||||
|
print(request)
|
||||||
json_data = await request.json()
|
json_data = await request.json()
|
||||||
|
if self.debug:
|
||||||
|
print(json_data)
|
||||||
result = self.jsonrpc(json_data)
|
result = self.jsonrpc(json_data)
|
||||||
|
if self.debug:
|
||||||
|
print(result)
|
||||||
body = json.dumps(result, cls=JSONRPCEncoder)
|
body = json.dumps(result, cls=JSONRPCEncoder)
|
||||||
response = Response(
|
response = Response(
|
||||||
text=body,
|
text=body,
|
||||||
|
|||||||
Reference in New Issue
Block a user