How use Basic authorization in API Action on frontend

Of course, I started with this, but a very strange problem arose which I described in another post