There's an external Flask backend, that I need to issue this request to using Axios:
import axios from "axios";
import FormData from "form-data";
const formData = new FormData();
formData.append("client", "client");
formData.append("endpoint", "endpoint");
const response = await axios.get(
URL,
{
headers: {
"User-Agent": client,
...formData.getHeaders()
},
data: formData,
}
);
const { data } = response;
The snippet above is what Postman suggest, but the backend returns this error message:
400 Bad Request: The browser (or proxy) sent a request that this server could not understand.
The original cURL request works fine in Postman:
curl --location --request GET 'URL' \
--header 'User-Agent: client' \
--form 'client="client"' \
--form 'endpoint="endpoint"'