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

361
Visualizações
Nuxtjs axios get status code from response from Rest API

I'm calling a Rest API that returns status codes. Some of them don't return Content in body. If i make in postman my calls i can get some status code like 202 Accepted, 200 OK... how can get it in Nuxtjs with axios. Any help would be very appreciated. enter image description here My code:

    async register() {
  const response = await this.$axios.$post('register/', {
  user: this.user,
  })
  console.log(response)
  // this.$nuxt.refresh()
  // this.status = response.status
  // if (this.status === 'register success') {
  //   this.$router.push('/login/')
  // }
}

and nothing show up :(

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I think it should be "this.$axios.post". There is not such method as $post.

From the official docs:

axios.post('/user', {
firstName: 'Fred',
lastName: 'Flintstone'})
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