K
K
keddad2020-08-05 00:55:18
Python
keddad, 2020-08-05 00:55:18

Why doesn't FastAPI process such a request with the appropriate handler?

I have a function like this:

@app.post("/api/parse/{network}/{page_id}")
async def process(network: str, page_id: str):
# код


I raise the service and make a request to it: And everything breaks. In the server logs I see On the client, respectively, also 404. Why is this happening? The view request must explicitly match . At the same time, a request to another method of the same service, but without parameters in the URI, passes normally, therefore, there are no problems with registering routes as such or anything else. What am I doing wrong?
requests.post("http://localhost/api/parse/VK/1")

"POST /api/parse/VK/1 HTTP/1.0" 404 Not Found

/api/parse/sometext/sometext/api/parse/{str}/{str}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
keddad, 2020-08-05
@keddad

Okay, I stepped a lot. FastAPI correctly processed this route, returned a 404 code inside, and it was invisible from the logs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question