Axios.Create by changing http baseurl to https

Asked

Viewed 1,744 times

0

Good afternoon. I have the following code in a study project on Reactjs that I am using Axios for requests.

import axios from 'axios';
    var url = 'http://site3.htempurl.com';

    const api = axios.create({
        baseURL: url,
        timeout: 1000,
        headers: {'Content-Type': 'application/json'}
    })

    export default api;

It turns out that when I test requisicoes on an api, it changes the baserl to https, error in the request.

Image 1: Error showing that https is being sent: inserir a descrição da imagem aqui

Image 2: how the api is being called in the service: inserir a descrição da imagem aqui

What can it be?

  • Can add errors and show some prints?

  • I edited the question by placing the prints.

  • In the network tab returns what status?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.