import com.baidubce.http.ApiExplorerClient; import com.baidubce.http.AppSigner; import com.baidubce.http.HttpMethodName; import com.baidubce.model.ApiExplorerRequest; import com.baidubce.model.ApiExplorerResponse; // 查询型号列表 Java示例代码 public class RequestDemo { public static void main(String[] args) { String path = "https://jucrite.api.bdymkt.com/car-evaluate-v2/trim"; ApiExplorerRequest request = new ApiExplorerRequest(HttpMethodName.POST, path); request.setCredentials("您的 access key", "您的 secret key"); request.addHeaderParameter("Content-Type", "application/x-www-form-urlencoded"); ApiExplorerClient client = new ApiExplorerClient(new AppSigner()); try { ApiExplorerResponse response = client.sendRequest(request); // 返回结果格式为Json字符串 System.out.println(response.getResult()); } catch (Exception e) { e.printStackTrace(); } } }
点击复制代码
{
"msg": "成功",//code对应的描述
"code": 200,//返回码,详见code返回码说明
"taskNo": "968545275134169633742173",//本次唯一请求号
"data": {
"list": [
{
"generation": "New_Model",
"year": 2015,
"modelId": "mod00010",
"abbrName": "2015款 ACS3 Sport",
"msrp": 1090000,
"brandId": "bra00010",
"name": "AC Schnitzer(进口) AC Schnitzer M3 2015款 ACS3 Sport",
"stopTime": "20170301",
"startTime": "20140901",
"id": "tri00001" //型号id
}
]
}
}
{
"msg": "参数不正确",
"code": 400
}
1,官方直连,权威校验;2,全实时优质接口,不参缓存,品质保证;3,多通道冗余切换,稳定可靠