I have web controller working with external system.
@http.route('/path/', auth='none', type="json", methods=['POST'], csrf=False, cors='*')def index(self, **kw):data = json.loads(request.httprequest.data) # I need raw data
return data
If I have type="json" I can get raw data from request without "parameters" via request.httprequest.data, but when I try to send response, I get
{ "jsonrpc": "2.0",
"id": null,
"result": {
"test": "data"
} }
But I need to receive just
{
"test": "data",
}
If I change type to "http" I can create correct response like this
headers = {"Content-Type": "application/json"}return Response(json.dumps(body), headers=headers)
But I have an error when I try to do a request
Function declared as capable of handling request of type 'http' but called with a request of type 'json'
It's external system, I can't change it. How to create a correct response without "result"?