I'm working with a Magento 2 project that need to upload image using a POST endpoint
How can I send image content to this endpoint?
Or I have to base64 the image at client side and send the base64 content to POST endpoint?
Thank you very much.
apiimage-uploadmagento2
I'm working with a Magento 2 project that need to upload image using a POST endpoint
How can I send image content to this endpoint?
Or I have to base64 the image at client side and send the base64 content to POST endpoint?
Thank you very much.
Best Answer
If you want to upload product image using rest api. You need to pass below parameters in your request.
Your media upload url - http://127.0.0.1/megento2/index.php/rest/V1/products/{sku}/media.
Method name - Post
Below are the body parameters :
Note : Make sure you pass base64_encoded_data of image.