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

616
Visualizações
How to convert cURL request to axios

I want to use the below cURL command with the axios. How I can do that?

curl -XPOST -d 'url=https%3A%2F%2Fgoogle.com%2F' 'https://goolnk.com/api/v1/shorten'

I have tried in this way but seems to be incorrect:

axios.post("https://goolnk.com/api/v1/shorten", {
   url: "https%3A%2F%2Fgoogle.com%2F"
}).then(function (response) {
      console.log(response)
   })
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You almost made it, but url key should just be a link string, without any special symbols.

axios
  .post('https://goolnk.com/api/v1/shorten', { url: 'https://google.com' })
  .then((res) => {
    console.log(res.data);
  });

Please, don't post code as images in the future, instead insert it as code block in the text.

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