skip to Main Content

Reactjs – post an image file to server

db.json The image file I posted to my db.json is missing. const createPost = async (title, image, description) => { const data = new FormData(); data.append('title', title); data.append('image', image); data.append('description', description); const response = await axios.post('http://localhost:3001/posts', data, { headers: {…

VIEW QUESTION

Reactjs – CORS policy issue in React and fetch

Im trying to fetch data from external api using fetch in react typescript component and having the error: Access to fetch at 'https://api.airtable.com/{my_data_base}' from origin 'http://localhost:3000' has been blocked by CORS policy: Request header field authentication is not allowed by…

VIEW QUESTION
Back To Top
Search