J
J
Jekson2020-05-25 17:00:25
Django
Jekson, 2020-05-25 17:00:25

How to understand where the source of the 400 error is?

The back is written in Django, the front is written in react. When I send a POST request, I get a 400 error.
In the uwsgi logs I find

Bad Request: /api/v1/vendors/upload_excel_rfi/20R6/417/0/
[pid: 9088|app: 0|req: 551/925] 93.84.150.241 () {56 vars in 1317 bytes} [Mon May 25 13:44:29 2020] POST /api/v1/vendors/upload_excel_rfi/20R6/417/0/ => generated 48 bytes in 373 msecs (HTTP/1.1 400) 6 headers in 185 bytes (2 switches on core 0)


In the browser developer console in the Console tab
xhr.js:178 POST https://api.spend-matters.qa.sumatosoft.work/api/v1/vendors/upload_excel_rfi/20R6/417/0/ 400 (Bad Request)


Clicking on xhr.jsmoves to a line of code with an erroneous status
// Send the request
    request.send(requestData);
  });
};

Failed to load resource: the server responded with a status of 400 (Bad Request)

I have no idea where to look for the source of the problem. Is it back or front?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question