问题
how do I upload an image (from the web) using Bigcommerce's Python API?
I've got this so far:
custom = api.Products.create(name='Test', type='physical', price=8.33, categories=[85], availability='available', weight=0)
Thank you! I've tried almost everything!
回答1:
This will create the product on the BigCommerce website. You create the image after creating the product, by entering the following line. The image_file
tag should be a fully qualified URL pointing to an image that is accessible to the BigCommerce website, being found either on another website or on your own webserver.
api.ProductImages.create(parentid=custom.id, image_file='http://www.evenmore.co.uk/images/emgrab_s.jpg', description='My image description')
来源:https://stackoverflow.com/questions/42003461/bigcommerce-python-api-how-do-i-create-a-product-with-an-image