react js http post 500 internal server error
export default function callApi2(endpoint, method = 'GET', body) {
let headers = { 'content-type': 'application/json' }
console.log(body);
return axios({
method: method,
url: `${Config.API_URL2}/${endpoint}`,
data: JSON.stringify(body),
headers: { 'content-type': 'application/json' },
}).catch(err => {
console.log(err);
}); res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Content-Type');
res.header('Access-Control-Allow-Methods','GET, POST, PATCH, PUT, DELETE, OPTIONS');
Also in JavaScript:
- how to cause a whole page reload react redux
- toggle jquery remove others
- JQuery UI Saving Sortable List
- js create array from for loop
- jquery when you typing in input
- how to restablished closed rxjs websocket
- javascript remove final newline from string
- react on hover reveal
- js how to add element in object
- javascript includes method getting 'hi' and 'high' problem
- command reboot android app react native adb command
- javascript rgb to hex
- html js drag image with mouse
- useeffect umnount
- react router browser refresh
- pass variable to regrex literal notation javascript
- javascript iterate through for loop
- How to install react native hooks with npm
- set dynamic route in link react js
- dark mode with react hooks
- react function called last state
- sort data according to date in js
- javascript convert timezone name to abbreviation
- How to get the path to the file that required your module?