Nathan
Nathan

Reputation: 41

Get response from strapi api for image in a component

I'm trying to get my url img in my axios response from fetching my posts content-type from strapi api. Here what I've done: I create my posts content-type and I create a components which contains fews media's slot:

enter image description here

Then I call the end point http://localhost:1337/api/posts?populate=* but I can't get any data from this components:

enter image description here

Upvotes: 3

Views: 2190

Answers (2)

Omar Naifar
Omar Naifar

Reputation: 1

try this one, i try it and it works for me:

http://localhost:1337/api/posts?populate=Posts.image

if you have images or image_video you can use this link:

http://localhost:1337/api/posts?populate=Posts.image&populate=Posts.images&populate=Posts.image_video

         

please tell me if that works for you!

Upvotes: -1

Hiteshu jani
Hiteshu jani

Reputation: 51

You will have to deeper into it. Call your endpoint like this:

http://localhost:1337/api/posts?populate[ImgWidget][populate]=*

Upvotes: 4

Related Questions