Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

252
Vistas
FastAPI: use HTTP 1.0 server

I have a simple HTTP API server

from typing import Dict

import uvicorn
from fastapi import FastAPI

app = FastAPI()


@app.post("/data/{uid}")
def data_post(uid: str, data: Dict):
    print(f"recieved data for {uid}: {data}")


if __name__ == "__main__":
    uvicorn.run(app)

Currently I am running it with uvicorn but this is not a requirement (other ASGI servers could work as well)

My problem is that the clients that call this API use HTTP 1.0 but the server responds with HTTP 1.1

curl -v --http1.0 -H "Content-Type: application/json" -d '{"a": 123, "b":"test"}' localhost:8000/data/123abc
*   Trying 127.0.0.1:8000...
* Connected to localhost (127.0.0.1) port 8000 (#0)
> POST /data/123abc HTTP/1.0
> Host: localhost:8000
> User-Agent: curl/7.77.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 22
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< date: Mon, 24 Jan 2022 13:43:12 GMT
< server: uvicorn
< content-length: 4
< content-type: application/json
< Connection: close
< 
* Closing connection 0

I would like to know if there is a way to configure uvicorn to use HTTP 1.0 or if there is another ASGI server that can be used with FastAPI applications that can achieve this.

Unfortunatelly I can not change the clients (they are a third party product) and currently they do not support HTTP 1.1.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda