showing results for - "react js http post 500 internal server error"
Axel
22 Feb 2018
1export default function callApi2(endpoint, method = 'GET', body) {
2
3  let headers = { 'content-type': 'application/json' }
4  console.log(body);
5
6  return axios({
7    method: method,
8    url: `${Config.API_URL2}/${endpoint}`,
9    data: JSON.stringify(body),
10    headers: { 'content-type': 'application/json' },
11  }).catch(err => {
12    console.log(err);
13  });
Bruno
28 Sep 2017
1 res.header('Access-Control-Allow-Origin', '*');
2 res.header('Access-Control-Allow-Headers', 'Content-Type');
3 res.header('Access-Control-Allow-Methods','GET, POST, PATCH, PUT, DELETE, OPTIONS');