如何从 java 中返回的 json 对象获取 odata.nextlink 并调用 odata.nextlink url
how to get odata.nextlink from the returned json object in java and call the odata.nextlink url
目前我正在使用
HttpSession session = (HttpSession) request.getSession();
AuthenticationResult result = (AuthenticationResult) session.getAttribute(AuthHelper.PRINCIPAL_SESSION_NAME);
String accessToken = result.getAccessToken();
String tenant = session.getServletContext().getInitParameter("tenant");
url = new URL("https://graph.windows.net/" + tenant + "/users/" + result.getUserInfo().getUniqueId()
+ "/memberOf?api-version=1.6");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
// Set the appropriate header fields in the request header.
con.setRequestMethod("GET");
con.setRequestProperty("api-version", "1.6");
con.setRequestProperty("Authorization", "Bearer " + accessToken);
con.setRequestProperty("Accept", "application/json;odata=minimalmetadata");
jsonResponse = HttpClientHelper.getResponseStringFromConn(con, true);
用户所属的returns组。它限制为 100,我得到 odata.nextlink。我目前不知道如何使用它并回忆起图表 api 来获取下一组 100
请帮忙!!
或者有什么方法可以将响应的极限提高到大于 100?
Usually, the odata.nextlink would show like : directoryObjects/$/Microsoft.DirectoryServices.User/b202e3e2-ead2-4878-8f77-81889ce30989/memberOf?$skiptoken=X'445370740900010000000000000000140000005948A9EA0D7571449DAAEF76844271C101000000000000000000000000000017312E322E3834302E3131333535362E312E342E32333331020000000000018020591539727941B538A64692E459E9'
然后,你只需要生成一个新的请求url作为:new URL("https://graph.windows.net/" + tenant + " /" +odata.netlink + "&api-version=1.6");
然后,再次请求授权 header。
谢谢。
目前我正在使用
HttpSession session = (HttpSession) request.getSession();
AuthenticationResult result = (AuthenticationResult) session.getAttribute(AuthHelper.PRINCIPAL_SESSION_NAME);
String accessToken = result.getAccessToken();
String tenant = session.getServletContext().getInitParameter("tenant");
url = new URL("https://graph.windows.net/" + tenant + "/users/" + result.getUserInfo().getUniqueId()
+ "/memberOf?api-version=1.6");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
// Set the appropriate header fields in the request header.
con.setRequestMethod("GET");
con.setRequestProperty("api-version", "1.6");
con.setRequestProperty("Authorization", "Bearer " + accessToken);
con.setRequestProperty("Accept", "application/json;odata=minimalmetadata");
jsonResponse = HttpClientHelper.getResponseStringFromConn(con, true);
用户所属的returns组。它限制为 100,我得到 odata.nextlink。我目前不知道如何使用它并回忆起图表 api 来获取下一组 100
请帮忙!! 或者有什么方法可以将响应的极限提高到大于 100?
Usually, the odata.nextlink would show like : directoryObjects/$/Microsoft.DirectoryServices.User/b202e3e2-ead2-4878-8f77-81889ce30989/memberOf?$skiptoken=X'445370740900010000000000000000140000005948A9EA0D7571449DAAEF76844271C101000000000000000000000000000017312E322E3834302E3131333535362E312E342E32333331020000000000018020591539727941B538A64692E459E9'
然后,你只需要生成一个新的请求url作为:new URL("https://graph.windows.net/" + tenant + " /" +odata.netlink + "&api-version=1.6");
然后,再次请求授权 header。
谢谢。