Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
  });
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #react #js #http #post #internal #server #error
ADD COMMENT
Topic
Name
9+8 =