0

I am using api gateway connected to a Flask Server.

The request itself is a GET Request containing this json -

{
    "tenantId": "tenant1",
    "customerIds": ["3a315f40-fafd-41a3-8d26-28d8033e053d"]
}

I am trying my requests in The Flask itself (Through it's public ip), and it Return 200 with a proper response -

{
  "documentsCount": {
    "archive": 0,
    "new": 49,
    "reported": 0
  },
  "tenantId": "005237f9-6779-4c68-89d6-d0800559d4f4"
}

When I try to test the request in api gw test zone, it also returns 200

But when I use the api gw's endpoint, it returns - "Failed to decode JSON object: Expecting value: line 1 column 1 (char 0)"

The return function looks like this -

return Trace.MakeResponse(api_name="getStatisticsResponse",
                          trace_id=request.headers.get('Trace-Id'),
                          status="200", message="", request_json=str(request.get_json()),
                          response_json=res)

What can I do for this endpoint to return the same responses as the Flask itself?

Yuval Ezrati
  • 61
  • 13

0 Answers0