我正在尝试动态传递我的后端请求的路径。但是路径变量是敏感参数,因此不允许我传递传入路径或任何字符串,例如 studentInfoEP->get("/student" + studentId);
知道我们该怎么做吗?
endpoint http:Client studentInfoEP {
url: "http://localhost:9091/studentinfo"
};
@http:ServiceConfig { basePath: "/studentfinder" }
service<http:Service> studentFinder bind listener {
@http:ResourceConfig {
methods: ["GET"],
path: "/{studentId}"
}
getStudentById(endpoint client, http:Request req, string studentId) {
var studentInfoResp = studentInfoEP->get(req.rawPath);
...
}
...
}