How to send a API POST request in Java or Android?

Thank you very much.

I found the solution for the Android Volley library. You have to add the following method:

@Override
            public byte[] getBody(){
                return "OFF".getBytes();
            }

With this method you are able to send plain text commands like “ON” or “OFF”

1 Like