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 = "http://www.api.bdymkt.com/size"; ApiExplorerRequest request = new ApiExplorerRequest(HttpMethodName.GET, path); request.setCredentials("您的 access key", "您的 secret key"); request.addHeaderParameter("Content-Type", "application/json;charset=UTF-8"); ApiExplorerClient client = new ApiExplorerClient(new AppSigner()); try { ApiExplorerResponse response = client.sendRequest(request); // 返回结果格式为Json字符串 System.out.println(response.getResult()); } catch (Exception e) { e.printStackTrace(); } } }
点击复制代码
{
"code": 1,
"msg": "调用成功",
"time": 1683371928,
"data": [
{
"is_hot_text": "非热门",
"id": 1,
"pid": 0,
"name": "职业",
"width": null,
"height": null,
"sizew": null,
"sizeh": null,
"icon_image": "11",
"is_hot": "非热门",
"child": [
{
"is_hot_text": "非热门",
"id": 20,
"pid": 1,
"name": "执业药师资格考试(一寸)",
"width": 413,
"height": 295,
"sizew": 25,
"sizeh": 35,
"icon_image": "11",
"is_hot": "非热门",
"child": []
}
]
}
]
}
{
"code": 0,
"msg": "调用失败",
"time": 1683371928,
"data":null
}
各种尺寸的证件照:示例:职业的。
微信小程序:标准证件照Plus