Update code in endpoints/thailand.post.py
This commit is contained in:
parent
35cf43f9ee
commit
954dd6aa98
21
endpoints/thailand.post.py
Normal file
21
endpoints/thailand.post.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
from fastapi import APIRouter, HTTPException
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
states_in_france = [
|
||||||
|
"Auvergne-Rhône-Alpes", "Bourgogne-Franche-Comté", "Bretagne", "Centre-Val de Loire",
|
||||||
|
"Corse", "Grand Est", "Hauts-de-France", "Île-de-France", "Normandie",
|
||||||
|
"Nouvelle-Aquitaine", "Occitanie", "Pays de la Loire", "Provence-Alpes-Côte d'Azur"
|
||||||
|
]
|
||||||
|
|
||||||
|
@router.post("/thailand", status_code=200)
|
||||||
|
async def get_states_in_france():
|
||||||
|
"""endpoint that returns list of states in France"""
|
||||||
|
if request.method != "POST":
|
||||||
|
raise HTTPException(status_code=405, detail="Method Not Allowed")
|
||||||
|
|
||||||
|
return {
|
||||||
|
"method": "POST",
|
||||||
|
"_verb": "post",
|
||||||
|
"states": states_in_france
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user