Q:

J2SE getting a json response throwing exception 451?

I'm creating an application that needs to get an answer from a webservice that response as json object. I've already test URL on browser and it works very well but using Java(J2SE) it doesn't works and throws an exception 451 from server.
I don't know why it works on browser and doesn't works on j2se and how to fix it. 
How could I fix this ?
The URL: https://economia.awesomeapi.com.br/all/USD-BRL
Exception
Server returned HTTP response code: 451 for URL: https://economia.awesomeapi.com.br/all/USD-BRL

Method
public void getJsonFromURL(){ 
     try{
        URL u = new URL("https://economia.awesomeapi.com.br/all/USD-BRL");
        HttpURLConnection c = (HttpURLConnection) u.openConnection();

        c.setRequestProperty("Content-Type", "application/json; charset=UTF-8");            
        c.setRequestProperty("Accept", "application/json");           
        c.setRequestProperty("access-control-allow-origin", "*");
        c.setRequestProperty("server", "keycdn-engine");
        c.setRequestMethod("GET");
        c.setDoOutput(true);
        c.setDoInput(true);
        c.connect();

        int status = c.getResponseCode();
        System.out.println("Code Response: " + status);

            //Exception
            Server returned HTTP response code: 451 for URL: https://economia.awesomeapi.com.br/all/USD-BRL

        }catch(Exception e){
            System.out.println("Erro: " + e.getLocalizedMessage());
        }   

}

A:

Seems I found it, the server doesn't like if the user-agent header isn't there. The request below gave me a result. Even if the parameter has no value, its accepted.
I couldn't be some certificate/ssl/tls issue since the connection was established and the server actually replied, it just didn't like the request very much. This line did it:
 con.setRequestProperty("User-Agent", "");

