简体   繁体   中英

Amazon ECS API to return secure images URL

I'm using the API to get list of products with parameters:

'Keywords' => 'search,
'Operation' => 'ItemSearch',
'SearchIndex' => 'All',
'AssociateTag' => 'my-tag',
'AWSAccessKeyId' => 'my-key-id',
'ResponseGroup' => 'Medium',
'Service' => 'AWSECommerceService',
'Timestamp' => gmdate('Y-m-d\TH:i:s\Z'),
'Version' => '2010-09-01',

I'm receiving images only from insecure server, eg

http://ecx.images-amazon.com/images/I/417YQ3xWx7L._SL75_.jpg

I have learned that this image is also available under the URL:

https://images-na.ssl-images-amazon.com/images/I/417YQ3xWx7L._SL75_.jpg

Can I make API to return the secure URL in the response?

I see this is an old question. Probably still actually.

You can replace the result url with simple str_replace.

$image-url = "http://ecx.images-amazon.com/images/I/417YQ3xWx7L._SL75_.jpg"

$new-image-url = str_replace('http://ecx.', 'https://images-na.ssl-', $image-url);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM