All Questions
6 questions
1
vote
2
answers
7k
views
How to send JSON or Form data to FastAPI backend through Axios JavaScript HTTP request?
I have a FastAPI backend configured as such:
@app.post("/engines/completions")
async def read_completions(
# engine_id:str,
prompt: Optional[str] = None,
max_tokens: Optional[int]...
1
vote
1
answer
2k
views
HTTP POST with axios: net::ERR_EMPTY_RESPONSE
I am trying to make a HTTP Post request through axios:
const onSubmit = (values) => {
console.log("submit", values);
// ctx.$i18n.locale = "en";
axios.post(...
0
votes
0
answers
216
views
POST http://127.0.0.1:8000/ 400 (Bad Request)
I am trying to create a client and upload an image in Form React Component, when I send it to the backend using Axios I get the message "POST http://127.0.0.1:8000/ 400 (Bad Request)". If I ...
0
votes
1
answer
345
views
How to replicate Python HTTP request inside Javascript without getting CORS error?
I'm able to make this request without any error using python:
async def send_request():
session = aiohttp.ClientSession()
body = {
'client_id': 'play-valorant-web-prod',
'...
5
votes
1
answer
25k
views
Django Rest Framework: HTTP 401 Unauthorized error
I am django rest framework jwt token package. For some reason, it is not receiving the token credentials. I am sure I am using axios in the correct format to store a token. I am unsure if the error is ...
0
votes
1
answer
250
views
Input being ignored on POST request with axios to a cherrypy function
So I am not sure which side of the code is wrong, the javascript or the python.
Basically I have reactjs forms, which are then to be submitted to the server and dealt with through cherrypy functions. ...