每一个,我都被困在从 REST API 获取 ImageURL 中使用 Android 中的 Retrofit 库。我的 JSON 示例是:
[{
"Id": 549,
"Product Name": "COFFEE",
"Product Code": null,
"ImageUrl": "/Uploads/images/product\\549\\549.jpg",
"Unit Name": "LY",
"Unit": 57,
"Category": 37,
"Category Name": "COFFEE",
"Price": 18 usd
}
]
我的 POJO
public class Food {
@SerializedName("Id")
@Expose
private String id;
@SerializedName("Product Name")
@Expose
private String productName;
@SerializedName("Product Code")
@Expose
private String productCode;
@SerializedName("ImageUrl")
@Expose
private String imageUrl;
@SerializedName("UnitName")
@Expose
private String tenDonViTinh;
@SerializedName("Unit")
@Expose
private String unit;
@SerializedName("Category")
@Expose
private String category;
@SerializedName("Caegory Name")
@Expose
private String categoryName;
@SerializedName("Price")
@Expose
private String price;
get...set
食品原料药
public interface FoodAPI {
String BASE_URL="http://dangbui.com"
@GET("")
Call
我的图片 URL 没有路径。那么,我应该获取并调用什么来获取图片?请帮助我。非常感谢!