title: Send request to other server in wordpress
body: <p>I have two website in wordpress </p>
  
  <p>Main site</p>
  
  <pre><code> 1.)http://www.abc.com
  </code></pre>
  
  <p>Other Site</p>
  
  <pre><code> 2.)http://www.xyz.com
  </code></pre>
  
  <p>From <code>mainsite</code> I want to send <strong>username</strong> and <strong>password</strong> to <code>othersite</code> for this i am using this code </p>
  
  <pre><code>    $creds = array();
      echo $creds['user_login'] = "sachin";
      echo $creds['user_password'] = "pass";
      $user = wp_signon( $creds, false );
     // echo ABSPATH . WPINC;
          if ( is_wp_error($user) ){
          echo $user-&gt;get_error_message();
              if( !class_exists( 'WP_Http' ) )
                   include_once( ABSPATH . WPINC. '/class-http.php' );
  
                          // You would edit the following:
              $username = $creds['user_login']; // Twitter login
              $password = $creds['user_password']; // Twitter password
              $message = "Hey neat, I'm posting with the API";
              // Now, the HTTP request:
              $api_url = 'http://www.xyz.com';
              $body = array( 'status' =&gt; $message );
              $headers = array( 'Authorization' =&gt; 'Basic '.base64_encode("$username:$password") );
              $request = new WP_Http;
              $result = $request-&gt;request( $api_url , array( 'method' =&gt; 'POST', 'body' =&gt; $body, 'headers' =&gt; $headers ) );
             // echo"&lt;pre&gt;";print_r($result['body']);
  </code></pre>
  
  <p>I dont know i am sending wp http request in right way or not but my problem is i want this username and password(i am sending from main site) to other server (<a href="http://www.xyz.com" rel="nofollow">http://www.xyz.com</a>)</p>
  
  <p>How I can do that please suggest me.please provide me your valuable suggestion how I can send <code>username</code> and <code>password</code> from one server to other server.</p>
  
  <p>Thanks</p>