Answers for "how to check request method was a get"

1

how to check request method was a get

import axios from 'axios';

const Api = axios.create({
  baseURL: 'https://example/',
});

Api.interceptors.response.use(response => {
  if (response.data.message && response.request._method !== 'GET') {
    console.log(response.data.message);
  }
  return response;
},
Posted by: Guest on February-11-2021

Code answers related to "how to check request method was a get"

Code answers related to "Javascript"

Browse Popular Code Answers by Language