Skip to content

Instantly share code, notes, and snippets.

@arminus
arminus / Nextcloud.java
Last active December 3, 2018 10:57
nextcloud-java-api exception
public class Nextcloud {
static String serverName = "nextcloud.meinserver.de/"; // needs a trailing slash, otherwise, something appends "ocs" to that string
static int port = 444;
static String userName = "myuser";
static String password = "mypass";
public static void main(String[] args) throws ClientProtocolException, IOException {
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet("https://nextcloud.meinserver.de:444/login");
CloseableHttpResponse response = httpclient.execute(httpGet);