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

333
Views
Ajax Get Request Cors AND ERR_ABORTED 401 Error

I have an API from trendyol.com (it is an e-commerce platform for Turkey)

When I try to get my products informations with api (it uses basic auth) I get CORS error (while dataType is "json"). If I change it as "jsonp", I get ERR_ABORTED 401 error. My auth informations are true, I am sure about this topic. Probably I have a problem about CORS. I am sending this request from my web page. (enginorun.xyz) I am not using chrome extension to ignore cors because if I develop my app with extension, will it work when I disable the extension. I am not sure. Please help me

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <h1>Trendyol Api Test</h1>
  </body>
</html>


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>

var url = "https://api.trendyol.com/sapigw/suppliers/supplier.id/products";

var username = "-";
var password = "-";


var settings = {
          'cache': false,
          'dataType': "jsonp",
          "async": true,
          "crossDomain": true,
       "credentials": "include",
          "url": url,
          "method": "GET",
          "headers": {
        'Access-Control-Allow-Origin': '*',
          "Authorization": "Basic -----",
              "accept": "application/json"          }
   }

      $.ajax(settings).done(function (response) {
          console.log(response);

      });

</script>

If I use jsonp error; error image

about 4 years ago · Juan Pablo Isaza
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!