Analyze the request and response json
luisdemarchi opened this issue · comments
Luís De Marchi commented
How do I print to the terminal to parse the body of the request and the response?
PS: before I even got into scheme
Vlad Frolov commented
It is unclear to me what you want to achieve. Use standard logging
module to log anything you want.
Luís De Marchi commented
@frol I need to see the body of the requisition, before arriving at my method POST. How do I do that?
A simulation of what I need:
@api.parameters(parameters.RequestParameters())
@api.response(schemas.ResponseSchema())
@api.response(code=HTTPStatus.UNAUTHORIZED)
@api.response(code=HTTPStatus.UNPROCESSABLE_ENTITY)
def post(self, args):
req_data = self.request.get_json(force=True)
print(req_data)
Vlad Frolov commented
You can use standard Flask methods:
from flask import request
def post(...):
print(request)