pythonasyncioapiasyncfastapiframeworkjsonjson-schemaopenapiopenapi3pydanticpython-typespython3redocreststarletteswaggerswagger-uiuvicornweb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
354 B
18 lines
354 B
from fastapi import FastAPI, Response
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
@app.get("/legacy/")
|
|
def get_legacy_data():
|
|
data = """<?xml version="1.0"?>
|
|
<shampoo>
|
|
<Header>
|
|
Apply shampoo here.
|
|
</Header>
|
|
<Body>
|
|
You'll have to use soap here.
|
|
</Body>
|
|
</shampoo>
|
|
"""
|
|
return Response(content=data, media_type="application/xml")
|
|
|