import { HttpRequest , HttpResponse , HttpClient } from '@/data/protocols/http' ; import axios , { AxiosResponse } from 'axios' ; export class AxiosHttpClient implements HttpClient { async request ( data ) { let axiosResponse ; try { axiosResponse = await axios . request ( { url : data . url , method : data . method , data : data . body , headers : data . headers } ) ; } catch ( error ) { axiosResponse = error . response ; } return { statusCode : axiosResponse . status , body : axiosResponse . data } ; } }