I want to send the JSON data to other computer web API server. I can't send data with Axios in Reactjs but Postman is working. These computers work on the same network.
ERROR in console;
OPTIONS https://192.168.1.214:5001/api/books 405 (Method Not Allowed)
Access to XMLHttpRequest at 'https://192.168.1.214:5001/api/books' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Uncaught (in promise) Error: Network Error at createError (createError.js:17) at XMLHttpRequest.handleError (xhr.js:80)
Error image : https://i.resimyukle.xyz/830y7z.png
addAnswers = async (dispatch, e) => {
e.preventDefault();
const newItem = {
"bookName" : "information",
"price" : "11.11",
"category" :"information",
"author" : "yazar"
}
const response = await axios.post("https://192.168.1.214:5001/api/books",newItem);
console.log(response);