score:5
Accepted answer
you have to enable cross-origin resource sharing on your server.
check this package :
var express = require('express')
var cors = require('cors')
var app = express()
app.use(cors())
app.post('/posturl', (req, res) => {
console.log(req.body);
res.send('111');
});
Source: stackoverflow.com
Related Query
- make post call to local express server in react
- Post an object with fetch using react js and express API server
- React Hooks: How to make a POST request to server
- fetch POST returns only _id object in Express API server React FrontEnd
- How to make API request from react client to express server running on the Heroku platform
- Using Cron to make an API call every day on express server
- Axios POST request in react to Express server is returning 404
- How to make Express server use React routes?
- How to POST and GET from mongoDB express server in react hooks?
- Post Local File from React to Express Results in 404 Error
- React with express server giving me 400 on post
- How to make a remote server call from a react component?
- Test a POST Http request from a local node server in REACT
- How to make Axios post call to an express parameterized route?
- React form POST to Express server not working - REST
- Fetch post api from React Client to express server causes error
- How to make a rest post call from ReactJS code?
- eslint error on deployment on local server of react web app
- eslint error on deployment on local server of react web app
- React router doesn't work on express server
- How can I pass data from express server to react views?
- how to share environment variables between react app and express js server hosting it as static site
- How to make a Soap call in React js?
- Express Session Cookie Not Being Set when using React Axios POST Request
- How to post data from react to express
- Fetch api post call returning 403 forbidden error in React js but the same URL working in postman
- Using express and es6 to render react and jsx server side
- React Native fetch a local server using a proxy
- How to make the API call and display it in React JS using React Table and Axios?
- React query mutation: getting the response from the server with onError callback when the API call fails
More Query from same tag
- React.semantic ui's Icones are not loading with webpack middle ware
- Accessing Passport's req.user within React (ES6)? API call returns req.user as undefined
- Trouble with file upload using javascript swagger client and react
- Custom antD Drawer and onClose not working
- React JS Unreachable code no-unreachable
- Reactjs array mutation
- Webpack css setup and best practise
- React post Build - Classes & Hooks dont Render
- React pass dom node as input to another component
- Node.js, React socket.io emit() not working
- all Images gets deleted instead of that particular image whose delete icon is clicked in reactjs
- Create React App : Range error - Maximum call stack size exceeded
- Executing client-side DOM manipulation after static rendering in NextJS
- How to track current accordion item using state in React?
- Adding input from textarea/form to a list with React
- React.js useState hook causes too many re-renders and cant update my state
- How to create nested stacknavigators in react native?
- Auto refresh a page in React.js
- useReducer and useContext Dispatch doesn't work in onClick function
- Submit button takes 2 clicks to generate output
- How can I get my component to redirect after successful action?
- graphql: how to handle prev page, next page, last page and first page properly?
- Render Header or Title to ant design - Timepicker component
- Fetch GET request with Reactjs - how do i implement a reusable component within my request to render my data?
- React child component lose ref of his parent after componentWillUnmount
- write a script to automatically run through my registration page react
- How to remove ReactJS warning related to using a `value` prop to a form field without an `onChange` handler when the handler is actually defined?
- How to keep the fetching queue in order
- ReactJS How to update the state in object which is in the array
- Component not updating when redux store modified