rest - 在 api 调用之前放心的 Microsoft 登录
问题描述
我有安全的 API,它在调用方法之前使用 Microsoft 登录。当我在未登录的情况下尝试放心
RestAssured.baseURI = url;
RequestSpecification httpRequest = RestAssured.given();
Response response = httpRequest.get();
// Retrieve the body of the Response
ResponseBody body = response.getBody();
// By using the ResponseBody.asString() method, we can convert the body
// into the string representation.
System.out.println("Response Body is: " + body.asString());
我得到以下回应
响应正文是:
<title>Sign in to your account</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0,
maximum-scale=2.0, user-scalable=yes">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<meta name="PageID" content="ConvergedSignIn" />
<meta name="SiteID" content="" />
<meta name="ReqLC" content="1033" />
<meta name="LocLC" content="en-US" />
<noscript>
我如何发送 microsoft 登录详细信息,然后将 session 用于其他 api 调用
解决方案
推荐阅读
- react-native - React Native Stack 维护的 React 导航
- adobe - AEM 调度程序需要在部署后自动启动
- java - 如何单击 selenium webdriver 中的剑道下拉菜单
- javascript - 如何在 NodeJS 中转换为导入/导出 ES 模块
- c++ - 不同 C++ 文件中未命名命名空间中的名称可以引用相同的命名事物吗?
- html - 使用 xpath 时找不到元素
- php - 如何使用 Laravel 查询构建器在 Postgresql 数据库中搜索不区分大小写的查询?
- javascript - 测试一个结合 Observables 的函数
- elasticsearch - 所有索引在 ElasticSearch 中突然被删除
- java - 在 spark java 中创建和管理 jdbc 连接的正确方法