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

362
Visualizações
Curl Request to Axios Request how?
curl -H "Authorization: Token token=sfg999666t673t7t82" -H "Content-Type: application/json" -d '{"phone_call": { "call_direction": true, "targetable_type": "contact", "targetable": { "id": "1", "first_name": "Jane", "last_name": "Sampleton (sample)", "work_number ":"5304915427", "mobile_number ":"11919457004 " }, "note ": { "description": "Sample note"} }}' -X POST https://domain.myfreshworks.com/crm/sales/api/phone_calls

When ı do this request ı succesfully get the response, but ı just want to same request with axios. How can I do that ? I try this but not works ı get'a cors error.


 const headers = {
      'Content-Type': 'application/json',
      Authorization: 'Token sfg999666t673t7t82',
    };
    var dataString =
      '{"phone_call": { "call_direction": true, "targetable_type": "contact", "targetable": { "id": "1", "first_name": "Jane", "last_name": "Sampleton (sample)", "work_number ":"5304915427", "mobile_number ":"11919457004 " }, "note ": { "description": "Sample note"} }}';

    Axios.post('https://domain.myfreshworks.com/crm/sales/api/phone_calls', dataString, {
      headers: headers,
    })
      .then((response) => {
        console.log(response);
      })
      .catch((error) => {
        console.log(error);
      });

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

0

The headers seem incorrect in your axios version.

Authorization: Token token=sfg999666t673t7t82 is not the same as Authorization: 'Token sfg999666t673t7t82'.

Try changing Authorization: 'Token sfg999666t673t7t82' to Authorization: 'Token token=sfg999666t673t7t82' so that the requests are equivalent.

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