Why do I always get 403 when fetching data with RestTemplate? [duplicate]
This question already has answers here : Closed last year . 403 Forbidden with Java but not web browser? (4 answers) I'm trying to fetch data but always getting 403(Forbidden) with RestTemplate . But when I try org.apache.http.client.HttpClient instead, everything is OK. I'm also able to get data with Postman on my machine. The code is quite simple but I don't know what's wrong. public Object get() { try { RestTemplate restTemplate = new RestTemplate(); Object result = restTemplate.getForObject("https://api.hearthstonejson.com/v1/19776/enUS/cards.json", Object.class); return result; } catch