• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Pruebas Online
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

145
Vistas
How to Send Token in x-www-form-urlencoded API Calling in react native

this type of API = x-www-form-urlencoded calling is new for me. please guide me on how can I send my token with this I tried this way but its not working

 let data = new URLSearchParams();
 data.append("account_type", asyncData.data?.account_type);
 
 const response = await fetch(URLs.update, {
        method: "POST",
        params:{ token }
        headers: {
          Accept: "application/json",
          "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
        },
        body: data.toString(),
      });
almost 3 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

using fetch method, this is how you can implement it :

    var myHeaders = new Headers();
    myHeaders.append("Authorization", "Bearer "+token);

    var requestOptions = {
      method: 'POST',
      redirect: 'follow',
      headers: myHeaders,
    };
    
    fetch(URLs.update, requestOptions)
      .then(response => response.json())
      .then(result => console.log(resutlt))
      .catch(error => console.log(error));
almost 3 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda