score:1
Accepted answer
can you try:
let form_data = new formdata;
form_data.append('action', 'send_form');
form_data.append('email', 'test@test.com');
form_data.append('message', 'testing');
axios.post(url, {
form_data
})
.then(function (response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});
Source: stackoverflow.com
Related Query
- React - WP_Mail works with jQuery but not axios
- Starting a php session from react with an axios call does not keep the session alive, but doing it with postman works just fine
- React - New Context API not working with Class.contextType, but works with Context.Consumer
- Request made with axios does not work but if it works with XMLHttpRequest
- Axios not updating state from API in function called on Click, but works on identical function on Component Mount in React
- React hooks with multiple state values not working but separate state value works
- simple Debounce not working in react 16 but works in jsfiddle with react 14.3
- React JS + React Router works with $.get but not $.ajax PUT
- Request to api works fine in component but not when using provider with react
- window.Calendly.initInlineWidget is not defined on first load but works after refresh with useEffect in React and Gatsby
- Go Restful API : CORS configuration works with React but not with Angular
- File Upload to BIM 360 works in Postman but not with React JS
- React Component CSS does not work when digit zero "0" is displayed but works fine with other values
- simple react works with npm start but not with nohup npm start &
- Cors error in React with axios but not with fetch
- problem with react prop where my function works in one context but not another
- Axios get in url works but with second parameter as object it doesn't
- React Routing works in local machine but not Heroku
- React setState not working on first try, but works on second?
- React app works on Chrome, but not Firefox
- React Native app works when run from Xcode, but crashes when run with 'react-native run-ios'
- react native app works on debug mode, but not works release mode on ios
- Put works in Postman but not AXIOS
- Forbidden (CSRF cookie not set.) with React and axios
- My link to manifest.json in index.html works when I run react script 'yarn start', but not when I run 'python3 manage.py runserver'
- React axios Error: Request aborted for delete request in Firefox but not in Chrome
- Styling react-select with CSS modules works on Sandbox but not on local machine
- React useState hook not updating with axios call
- URL changes but page new page is not rendered Ionic React , IonReactRouter with history
- Images not loading on route with params but works on routes without params
More Query from same tag
- ClearInterval not within scope
- How to filter through cards based on the value using onChange when selected in a dropdown
- React Draggable - How to remove border?
- How To Call A JavaScript Function Returned From NodeJS in ReactJS JSX
- React JS Events Not Firing for the Last rendered element
- ReactJS: show modal with loading message during superagent ajax request
- Call an ActionCreator from another ActionCreator
- React-Router-Dom Hash Router
- Dev tools show many websocket requests of chat app built by react hook with functional component
- Removing event Listeners in react using highcharts
- Redux - Returns call function informations to update props / state
- react-big-calendar: Cannot read property 'momentLocalizer' of undefined
- Having an array of Objects as a props for a React component
- How to prevent extra hook calls on redux state change?
- File Upload empty on submit
- Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined component issue
- "React.createContext is not a function" in CodeSandbox when using `@emotion/core` and latest version of React
- Reducer updates state object which it should not be able to access
- react I want to overwrite the value of an object
- React render component only for few seconds
- Vite and Sendbird does not works
- How to handle user permission base on role?
- Jest: tests can't fail within setImmediate or process.nextTick callback
- react populate modal from graphql
- Using discriminating unions in react props with a default
- How to add another className in react if I use CSS Modules?
- Cannot map on element from axios response react
- Cannot read property 'type' of undefined (react-router-redux)
- React router app - Route title
- Error: Multiple children were passed to <Link> with `href` of `/posts` but only one child is supported