How to Post Product with Image on REST API in Magento 2

apiimagemagento2rest

I'm trying to post an image to a product, but on post I dont know where exactly to put it.
Should I put on custom_attributes as when I get it on GET ? Didn't have success, even using image, small_image and thumbnail and the same link image as one that I added manually.
Or should I use other way like Media Gallery Entries? If so could I get an example? because on documentation they only tell me things like "string" and don't know which are the possibilities.

Thanks.

Best Answer

request url : magentourl/index.php/rest/V1/products/sku/media use this :

{
  "entry": {
  "media_type": "image",
  "label": "Image",
  "disabled": false,
        "types": [
            "image",
            "small_image",
            "thumbnail"
        ],
  "file": "string",
  "content": {
  "base64_encoded_data": "basec64encoded",
  "type": "image/png",
  "name": "new_image2.png"
  }
 }
}