So i am consuming JSON response from this URL through RestTemplate Link:
"https://s3-ap-southeast-1.amazonaws.com/he-public-data/productdf38641.json"
My Product POJO:
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ProductModel {
private String uniq_id;
private String product_name;
private int retail_price;
private int discounted_price;
private List<String> image;
private String description;
private String product_rating;
private String overall_rating;
private String brand;
}
Now when i use restTemplate to store this Array of Json object in ProductModel[].
ProductModel[] books = restTemplate.getForObject(URL, ProductModel[].class);
I am getting this error
Caused by: org.springframework.web.client.UnknownContentTypeException: Could not extract response: no suitable HttpMessageConverter found for response type [class com.schema.testing.domain.ProductModel] and content type [binary/octet-stream]
when i pass the same JSON object though postman to REST endpoint via POST request. it is able to process that request. IS this all game related to content-type. Please help , what do i have to do next. i am not sure . Any help is appreciated