title: HTML POST insert line break in parameters
body: <p>currently I am trying to use <code>hilite.me/api</code> to format Java code. It all works ok but the only problem is that <code>\n</code> line breaks seem to be ignored and the output is just one long line. Anyone know how I can properly pass in linebreaks into the POST request. Thanks.
  The API is parameters are supposed to be as follows: <code>code=</code> the Java code to be inputted. <code>lexer=</code> language to format in (in this case Java)</p>
  
  <p>My code:</p>
  
  <pre><code>public static final String USER_AGENT = "Mozilla/5.0", HILITE_URL = "http://hilite.me/api";
  
  public static String hilite(String lang, String code) throws Exception {
      URL obj = new URL(HILITE_URL);
      HttpURLConnection conn = (HttpURLConnection) obj.openConnection();
  
      conn.setRequestMethod("POST");
      conn.setRequestProperty("User-Agent", USER_AGENT);
  
      String par = "&amp;code=" + code.replaceAll("\n", "\r\n") + "&amp;?lexer=" + lang;
  
      conn.setDoOutput(true);
      DataOutputStream dos = new DataOutputStream(conn.getOutputStream());
      dos.writeBytes(par);
      dos.flush();
      dos.close();
  
      int res = conn.getResponseCode();
  
      if(res == 200){
          StringBuilder sb = new StringBuilder();
          String in;
          BufferedReader read = new BufferedReader(new InputStreamReader(conn.getInputStream()));
          while((in = read.readLine()) != null)
              sb.append(in + "\n");
          read.close();
          return sb.toString();
      }else{
          System.err.println("UNABLE TO CONNECT! WITH RES: " + res);
          return null;
      }
  }
  </code></pre>