产品详情
API参数 获取考题 调用地址: http,https://jisuapidriverexam.api.bdymkt.com/driverexam/query 请求方式: POST 支持格式: application/json;charset=UTF-8 调用工具: 去调试 请求参数(Headers) 请求参数(Query)
- 名称
- 类型
- 是否必须
- 示例值
- 描述
- type
- string
- true
- null
- 题目类型 分为A1,A3,B1,A2,B2,C1,C2,C3,D,E,F 默认C1
- subject
- string
- false
- null
- 科目类别 1为科目一 4为科目四 默认1
- pagesize
- string
- false
- null
- 每页数量 默认1
- pagenum
- string
- false
- null
- 当前页数
- sort
- string
- false
- null
- 排序方式 正常排序normal 随机排序rand 默认normal
- chapter
- string
- false
- null
- 章节 科目一为1-4 科目四为1-7
<dependency>
<groupId>com.baidubce</groupId>
<artifactId>api-explorer-sdk</artifactId>
<version>1.0.0</version>
</dependency>
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://gwgp-h8mnmdi6hqr.n.bdcloudapi.com/driverexam/query";
ApiExplorerRequest request = new ApiExplorerRequest(HttpMethodName.POST, path);
request.setCredentials("您的 access key", "您的 secret key");
request.addHeaderParameter("Content-Type", "application/json;charset=UTF-8");
request.addQueryParameter("type", "");
request.addQueryParameter("subject", "");
request.addQueryParameter("pagesize", "");
request.addQueryParameter("pagenum", "");
request.addQueryParameter("sort", "");
request.addQueryParameter("chapter", "");
ApiExplorerClient client = new ApiExplorerClient(new AppSigner());
try {
ApiExplorerResponse response = client.sendRequest(request);
// 返回结果格式为Json字符串
System.out.println(response.getResult());
} catch (Exception e) {
e.printStackTrace();
}
}
}
点击复制代码
正常返回示例 {
"status": 0,
"msg": "ok",
"result": {
"total": "950",
"pagenum": "1",
"pagesize": "3",
"subject": "1",
"type": "C1",
"sort": "normal",
"list": [
{
"question": "未取得驾驶证的学员在道路上学习驾驶技能,下列哪种做法是正确的?",
"option1": "A、使用所学车型的教练车由教练员随车指导",
"option2": "B、使用所学车型的教练车单独驾驶学习",
"option3": "C、使用私家车由教练员随车指导",
"option4": "D、使用所学车型的教练车由非教练员的驾驶人随车指导",
"answer": "A",
"explain": "《公安部令第123号》规定:未取得驾驶证的学员在道路上学习驾驶技能,使用所学车型的教练车由教练员随车指导。",
"pic": "",
"type": "C1,C2,C3"
},
{
"question": "在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂哪种标志?",
"option1": "A、注意新手标志",
"option2": "B、注意避让标志",
"option3": "C、统一式样的实习标志",
"option4": "D、注意车距标志",
"answer": "C",
"explain": "《公安部令第123号》第六十四条规定:在实习期内驾驶机动车的,应当在车身后部粘贴或者悬挂统一式样的实习标志。",
"pic": "",
"type": "C1,C2,C3"
},
{
"question": "机动车驾驶人在实习期内驾驶机动车不得牵引挂车。",
"option1": "",
"option2": "",
"option3": "",
"option4": "",
"answer": "对",
"explain": "《公安部令第123号》第六十五条规定:机动车驾驶人在实习期内不得驾驶公共汽车、营运客车或者执行任务的警车、消防车、救护车、工程救险车以及载有爆炸物品、易燃易爆化学物品、剧毒或者放射性等危险物品的机动车;驾驶的机动车不得牵引挂车。",
"pic": "",
"type": "C1,C2,C3"
}
]
}
}
失败返回示例 错误码定义
