[Python] Deployed Krakend Django microservice not receiving any input data given in json body

Discussão em 'Python' iniciado por Stack, Novembro 20, 2024.

  1. Stack

    Stack Membro Participativo

    I have a Django application deployed with Krakend gateway. All endpoints are active. But the service is unable to access the request data.

    I'm giving the request as below

    curl --location 'https://backend-dev-url.com/api/v1' \
    --header 'Content-Type: application/json' \
    --data '{
    "a":"value",
    "b":"value"
    }'


    This is the response that i get

    {

    "a": [
    "This field is required."
    ],
    "b": [
    "This field is required."
    ]

    }


    I'm passing all the missing variables correctly. But somehow it is not reaching the service. It works perfectly on localhost. The issue is only with the deployed instance.

    Below is the krakend configuration part for this microservice

    {
    "endpoint": "api/v1",
    "method": "POST",
    "output_encoding": "no-op",
    "backend": [
    {
    "url_pattern": "api/v1",
    "encoding": "no-op",
    "sd": "static",
    "method": "POST",
    "host": ["http://localhost:8000"],
    "disable_host_sanitize": false
    }
    ],
    "input_headers": ["Authorization","Content-Type"],
    "extra_config": {
    "qos/ratelimit/router": {
    "max_rate": 100,
    "client_max_rate": 60,
    "every": "1m",
    "strategy": "ip"
    }
    }
    }


    Thanks.

    Continue reading...

Compartilhe esta Página