So I solved the problem. I changed the accepted format by adding "req.setHeader('accept', 'application/json');" in case anyone needs it.
Http h = new Http();
HttpRequest req = new HttpRequest();
HttpResponse response = h.send(req);
Thank you Roland for helping me!