Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL path with colon (":") results in 404 not found on POST? #4984

Closed
9 tasks done
dwinston opened this issue Jun 3, 2022 · 4 comments
Closed
9 tasks done

URL path with colon (":") results in 404 not found on POST? #4984

dwinston opened this issue Jun 3, 2022 · 4 comments
Labels
question Question or problem question-migrate

Comments

@dwinston
Copy link

dwinston commented Jun 3, 2022

First Check

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the FastAPI documentation, with the integrated search.
  • I already searched in Google "How to X in FastAPI" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answer.
  • I already checked if it is not related to FastAPI but to Pydantic.
  • I already checked if it is not related to FastAPI but to Swagger UI.
  • I already checked if it is not related to FastAPI but to ReDoc.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

from fastapi import FastAPI

app = FastAPI()

@app.post("/items:queue")
def queue_new_item(item: dict):
    return "An item has been queued for later inclusion."

Description

  • Open the browser and POST /items:queue
  • I expect the string response "An item has been queued for later inclusion."
  • I get a 404 not found response, with JSON body {"detail": "Not Found"}

Operating System

macOS

Operating System Details

No response

FastAPI Version

0.78.0

Python Version

Python 3.9.12

Additional Context

No response

@dwinston dwinston added the question Question or problem label Jun 3, 2022
@dwinston
Copy link
Author

dwinston commented Jun 3, 2022

I realize this may be an issue upstream with Starlette, so I have started a discussion topic there: encode/starlette#1673.

@Kludex
Copy link
Sponsor Collaborator

Kludex commented Jun 7, 2022

This is solved on Starlette 0.20.2.

FastAPI still doesn't support that Starlette version.

Note: By the time this was written, FastAPI is on version 0.78.0.

@yuanjie-ai
Copy link

Uploading image.png…

@bodograumann
Copy link

Duplicate of #4892

Repository owner locked and limited conversation to collaborators Feb 28, 2023
@tiangolo tiangolo converted this issue into discussion #8513 Feb 28, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Question or problem question-migrate
Projects
None yet
Development

No branches or pull requests

5 participants