HttpUrlConnection Post with header info but no body

I am developing an Android app that uses an API I developed.

I am doing this connection using HttpUrlConnection and so far the login works fine. The problem arises with the logout. It´s not doing anything. When I do the logout request with Postman then it works fine, but with HttpUrlConnection it does not.

The logout works like this:
Do a POST request to http://ipaddress:12345/api/LogOut

and in the header include the token of the logged user. Then the server should go to the database and delete the token for that user:

This is how I´m trying to do the request:

URL url = new URL(getString(R.string.url) + "LogOut");
HttpURLConnection con = (HttpURLConnection) url.openConnection();

con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Token", TokenSingleton.getToken());

con.setReadTimeout(10000);
con.setConnectTimeout(15000);
con.setRequestMethod("POST");
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);

con.connect();
con.getOutputStream().flush();
con.getOutputStream().close();
con.disconnect();