Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

309
Views
Obtener la llamada Api a una API externa da como resultado un error de CORS, pero en el navegador funciona bien

Estoy tratando de hacer una llamada de búsqueda a un servidor web a través de apis.

 var requestOptions = { method: 'GET', redirect: 'follow' }; fetch( "https://api-mainnet.magiceden.dev/v2/collections?offset=0&limit=3", requestOptions ) .then((response) => response.text()) .then((result) => console.log(result)) .catch((error) => console.log("error", error));

Esto parece arrojar este error ingrese la descripción de la imagen aquí

 Access to fetch at 'https://api-mainnet.magiceden.dev/v2/collections?offset=0&limit=3' from origin 'null' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Pero la misma url si trato de acceder en el navegador. Muestra los datos. Ingrese la descripción de la imagen aquí Cualquier ayuda sobre cómo puedo hacer que funcione la llamada api fetch sería muy apreciada.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

¿Cuáles son sus "opciones de solicitud"? He probado esto, y está funcionando bien.

 fetch("https://api-mainnet.magiceden.dev/v2/collections?offset=0&limit=3" ) .then((response) => response.text()) .then((result) => console.log(result)) .catch((error) => console.log("error", error));
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!