Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 651

Getting invalid header for post request in FastAPI [duplicate]

$
0
0

I am building some small scale application with FastAPI(newbie) and python. I am trying to add post request to my application but everytime i try to make a post request it shows invalid header with 400 status (bad request), Can anyone help me resolve this?below is my method for post request-

 from fastapi import APIRouter, HTTPException, Request    from fastapi.responses import JSONResponse    router = APIRouter()#new the get req@router.get("/productlist")async def get_data(path: str):#does something works fine#now the post req@router.post("/test")async def upload_data():#this never gets hit i dont understand why#I tried printing some values at start of the function still no luck

i get following response

enter image description here


Viewing all articles
Browse latest Browse all 651

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>