この記事では、APIへの問い合わせ時にJSONの各項目の型を明確にしながらaxiosを利用してみます。 (get, postなどの基本的なメソッドに絞った内容です。) JSみたいに利用する JSと同じようにaxiosを利用すると、成功時のレスポンス・エラー時のレスポンスそれぞれがanyになります。 import axios from 'axios' axios.post( 'https://reqres.in/api/register', { email: 'eve.holt@reqres.in', password: 'pistol', } ) .then(res => { // res.dataはanyになる console.info('token: ' + res.data.token) }) .catch((e) => { if (e.response !== undefined)