I'm trying does a request http in the Cloudant, but I receiving "Unauthorized".
HttpsURLConnection conn;
URL url = new URL(MyURL+"/_all_dbs");
conn = (HttpsURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.connect();
The curious, it's that with curl in terminal this works! Like:
curl 'MyURL/_all_dbs' -X GET
this works fine! And I receiving a list of my databases. But in the Java code not, I receiving 401 error. Also, I can't using the library Cloudant-Client because other problems ocurrs and I need this working with HTTP because will serve for other application that must only HTTP request.