title: LibCurl C Http Post/Get
body: <p>I am converting a Perl program to C using libcurl</p>
  
  <pre><code>sub IsAdmin() {
      $r = &amp;HTTPGet("http://".$_[0]."wp-admin/edit.php");
      if (!$r-&gt;is_success) { return FALSE; }
      if ($r-&gt;content =~ /wp-admin\/post.php\?/) {
              return TRUE;
      }
      return FALSE;
   }
  </code></pre>
  
  <p>And this one</p>
  
  <pre><code>sub IsWordPress() {
      my $url = $_[0];
      $url =~ s/http:\/\///;
      my $new_url = "http://" . $url . "/wp-login.php";
      my $r = &amp;HTTPGet($new_url);
      if ($r-&gt;content =~ /action=lostpassword/) {
              return TRUE;
      }
      return FALSE;
  }
  </code></pre>
  
  <p>My program will send an HTTP request and see if the response contains a specific string; for example <code>action=lostpassword</code>.</p>
  
  <p>I want to send an HTTP POST request and get the base URL, regardless of redirections, and the contents of the response.</p>