-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
hello.py
from fastapi import FastAPI, Header
app = FastAPI()
@app.post("/agent")
def get_agent(user_agent:str = Header()):
return user_agent
and
http -v localhost:8000/agent returns the following from HTTPie:
GET /agent HTTP/1.1
Accept: /
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: localhost:8000
User-Agent: HTTPie/3.2.2
HTTP/1.1 405 Method Not Allowed
allow: POST
content-length: 31
content-type: application/json
date: Mon, 20 May 2024 19:35:55 GMT
server: uvicorn
{
"detail": "Method Not Allowed"
}
storenth and nafanz
Metadata
Metadata
Assignees
Labels
No labels