Converts curl commands to java.net.httpurlconnection