A
A
Alexey Bespalov2019-05-07 04:07:14
JavaScript
Alexey Bespalov, 2019-05-07 04:07:14

How to make an ajax request to 1C with authorization?

I'm trying to make an ajax request to 1C. Nevertheless on all attempts and variants I receive errors.
5cd0d9a087413616664977.png5cd0d9ad20a45201689626.png

axios({
        method: "get",
        url:
          "http://localhost/bespalov_trade/hs/api/GetInfoByTel?tel=9999999999",
        auth: {
          username: "web",
          password: "123"
        }
      })
        .then(function(response) {
          console.log(response);
        })
        .catch(function(error) {
          console.log(error);
        });

CORS headers from the 1C side are exposed. The problem seems to be with authorization. Authorization passes through the browser and php, but not through JS.
Tell me how to win?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question