title: convert curl to httpclient post
body: <p>I'm new to cURL, can we do the same thing in httpclient and httppost?
  If yes, what is the equivalent code for the cURL below.</p>
  
  <pre><code>$xml = '&lt;test&gt;';
  $xml .= '&lt;date&gt;'.date("d/m/Y", time()).'&lt;/date&gt;';
  $xml .= '&lt;time&gt;'.date("H:m:s", time()).'&lt;/time&gt;';
  $xml .= '&lt;param&gt;'.$input.'&lt;/param&gt;';
  $xml .= '&lt;/test&gt;';
  
  // get the host
  $curl=curl_init("http://someurl.com");
  
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  //curl_setopt($curl, CURLOPT_VERBOSE, 1); // debug
  curl_setopt($curl, CURLOPT_POST, 1);
  curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (FD)");
  curl_setopt($curl, CURLOPT_POSTFIELDS, $xml);
  
  curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
  
  $response = curl_exec($curl);
  </code></pre>