Search
 
SCRIPT & CODE EXAMPLE
 

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);
  });
Comment

react js http post 500 internal server error

 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');
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to run and clone react app 
Javascript :: patterns in javascript 
Javascript :: image react 
Javascript :: local storage in vanila javascript 
Javascript :: update angular project 
Javascript :: nodejs add new property array object 
Javascript :: second largest number in array javascript 
Javascript :: angular ng owl date time custom format 
Javascript :: hello world in javascript 
Javascript :: javascript date get next 15 minutes 
Javascript :: wait until a function finishes javascript 
Javascript :: 2d array in js 
Javascript :: how-to-reset-a-form-using-jquery 
Javascript :: set selected option jquery 
Javascript :: format json command line 
Javascript :: add next to react 
Javascript :: get javascript component position 
Javascript :: javascript es6 class 
Javascript :: javascript selector second element nth child element 
Javascript :: javascript check if visible 
Javascript :: call multiple functions onclick react 
Javascript :: jquery datatable rest api 
Javascript :: java script remove last charecter from the string 
Javascript :: javascript select function 
Javascript :: Open temporary webpage js 
Javascript :: active-class router-link 
Javascript :: anchor click event angular refresh page 
Javascript :: replace character inside a string in JavaScript 
Javascript :: js substr 
Javascript :: instalar bootstrap en react 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =