I'm trying to send some HTTP commands using URLConnection and HttpURLConnection. I can send a GET request just fine but my POST request isn't working quite as I want it to. Here's my code:
Spoiler:
What happens right now is that the code sends out a command that looks like "POST /COMMAND?Value1 HTTP/1.1" From this I get a "405 Method Not Allowed." When I send the same command and value using cURL the packet request looks like "POST COMMAND HTTP/1.1 (aplication/x-www-form-urlencoded)" and Value1 is on the interior of the packet. I've searched all over Stackoverflow (they've got a nice tutorial on URLConnection) but can't find a solution to this problem. Any ideas? I can provide more information but need prompting.
