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

155
Visualizações
put request firebase realtime database

I am using real-time Database:

enter image description here

This is a put request in which users generate key onClick. This is working fine.

When a send user login from different device it just replaces the previous user.

enter image description here

It does not add a new user history

import axios from 'axios';

const endPoint = 'https://*_hide_.firebaseio.com/userHistory.json/'


export const UserHistory = (data) => {
     let token = localStorage.getItem('token')
     return axios.put(endPoint,JSON.stringify(data), {
        headers :{ 
           'Content-Type': 'application/json',
           'Authorization': 'Bearer'+ token
      }
   }) 
}
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Calling put on a path replaces any existing value at that path with the value that you specify.

If you want to add a new child node under the path, you should use post instead of put.

If you want to merge the data you specify with any existing values at the path, you should use patch instead of put.

For more on this, also see the Firebase documentation on writing data to the Realtime Database with its REST API.

about 4 years ago · Juan Pablo Isaza Relatório
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