Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

517
Views
Strapi v4 REST API :GET image

please I am working with the new strapi v4 and... In the old versions of strapi all I needed to do in order to get the image from my collection type was to get it like: <img src={config.baseURL + product?.productImg?.formats?.thumbnail?.url} /> but when I try to do the same now, it gives me the url address, but the response says

{"data":null,"error":{"status":404,"name":"NotFoundError","message":"Not Found","details":{}}}

Any help?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

I realised it. In my config file I had the baseURL as 'localhost:1337/api'. However for images, you must request without the '/api' so the request should be just 'localhost:1337' and then the image route.

about 4 years ago · Juan Pablo Isaza Report

0

with strapi v4 u need to manually populate your rest api with images otherwise it's restricted due to security reasons :

localhost:1337/api/posts?populate=*

then you will get images on your endpoint

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!