Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

161
Visualizações
Unable to access JSONBin.io even I have added the Auth Headers

So, basically, I am trying to get data from JSONbin.io. I have set the RequestHeader before I send the request. As you see there's beforeSend and xhr.setRequestHeader("X-Master-Key", "$2b$10$QCzFeVffyq7vaiSBUfPbCeXUGV.IBpiHlWIOsDQAgj########");. But, it still say Error 401 aka unauthenticated request. I wondering if someone can help me with this. I also provide image that show that the headers is there.

Link: https://jsonbin.io/api-reference

Image: https://ibb.co/jGtFLk9

    <script>
      function getKey() {
        $.ajax({
            url: 'https://api.jsonbin.io/b/624efc9cd8a4cc06909d66cd/2',
            type: "GET",
            dataType: "json",
            beforeSend: function(xhr) {
                xhr.setRequestHeader("X-Master-Key", "$2b$10$QCzFeVffyq7vaiSBUfPbCeXUGV.IBpiHlWIOsDQAgj########");
            },
            success: function(data) {
                const keyStore = data.keys;
                var copyKey = document.getElementById("KeyDisplay");
                document.getElementById('KeyDisplay').value = keyStore[Math.floor(Math.random() * 49)]
                document.getElementById('Button').textContent = "Copied Key"
                document.getElementById("Button").disabled = true;
                copyKey.select();
                navigator.clipboard.writeText(copyKey.value);
            }
        });
      }
    </script>
    ```


  [1]: https://i.stack.imgur.com/zQxGv.png
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda