title: How to add product image via the woocommerce REST API?
body: <p>I am working with the Woocommerce REST API and need to add a product to the store.</p>
  
  <p>It worked before. Now I have this error:</p>
  
  <pre><code>stdClass Object ( [errors] =&gt; Array ( 
    [0] =&gt; stdClass Object ( [code] =&gt; 
    woocommerce_api_invalid_remote_product_image 
    [message] =&gt; Error getting remote image 
    https://www.google.lt/images/srpr/logo11w.png ) ) )
  </code></pre>
  
  <p>Here is the documentation for adding a product via the WooCommerce REST API
   <a href="http://woothemes.github.io/woocommerce-rest-api-docs/#create-a-product" rel="nofollow">http://woothemes.github.io/woocommerce-rest-api-docs/#create-a-product</a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>$dataArray = array(
              'title' =&gt; 'xxxxxxxxxx',
              'description' =&gt; 'description1',
              'price' =&gt; '69',
              'sku' =&gt; 'sku2',
              'tags' =&gt; 'tag1, tag2, tag3',
              'color' =&gt; array('red', 'blue'),
              'size' =&gt; array('S', 'M'),
              'image' =&gt; 'https://www.google.lt/images/srpr/logo11w.png'
              );
  
  public function addProduct($data)
  {
      $wc_api = $this-&gt;_getClient();
  
  
      $newProductData = array(
          'product' =&gt; array(
              'title' =&gt; $data['title'],
              'type' =&gt; 'variable',
              'regular_price' =&gt; $data['price'],
              'description' =&gt; $data['description'],
              'sku' =&gt; $data['sku'],
              'tags' =&gt; [ $data['tags'] ],
              'images' =&gt; [ array('src' =&gt; $data['image'], 'position' =&gt; '0') ],
              'virtual' =&gt; true
          )
      );
  
      return $wc_api-&gt;create_product($newProductData);
  }
  </code></pre>
  
  <p>I'm using this client to call the REST API</p>
  
  <p><a href="https://github.com/kloon/WooCommerce-REST-API-Client-Library" rel="nofollow">https://github.com/kloon/WooCommerce-REST-API-Client-Library</a></p>
  
  <p>EDITED:
  If I get image from wordpress where woocommerce is hosted then all is fine. But, if I use a link from another site then I get an error.</p>