What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-11 19:57:25
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)... Add solution -
Javascript 2021-11-10 13:50:15
vuex-module-decorators nuxt axios
// /utils/api.ts import { NuxtAxiosInstance } from '@nuxtjs/axios' let $axios: NuxtAxiosInstance export function initializeAxios(axiosInstance: NuxtAxiosInstance) { $axios = axiosInstance } export { $axios } ------------------------ // /plugins/axi... Add solution -
Javascript 2021-11-10 09:27:27
axios 200 goes into then and catch
this issue happen when your response have an error , for example when the response is correct but in the then response you do something that throw an error , axios then catch that error , even if the response from the server was success Add solution -
Javascript 2021-11-10 07:07:11
how to use axios get
const axios = require('axios'); // Make a request for a user with a given ID axios.get('/user?ID=12345') .then(function (response) { // handle success console.log(response); }) .catch(function (error) { // handle error console.log(e... Add solution -
Javascript 2021-11-09 23:26:14
Nuxt js '@nuxtjs/markdownit'
export default { async asyncData({ $axios, $md }) { //I am also using axios to get the content from the Strapi API. const home = await $axios.$get("/home-page"); //This is where I use $md to parse the markdown for the example in t... Add solution -
Other 2021-11-09 13:14:17
infinite-scroll react
import { useState } from "react"; import useInView from "react-cool-inview"; import axios from "axios"; const App = () => { const [todos, setTodos] = useState(["todo-1", "todo-2", "..."]); ... Add solution