|
|
|
@ -33,7 +33,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"execution_count": 48,
|
|
|
|
|
"metadata": {
|
|
|
|
|
"dotnet_interactive": {
|
|
|
|
|
"language": "csharp"
|
|
|
|
@ -45,51 +45,44 @@
|
|
|
|
|
"languageId": "polyglot-notebook"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"source": [
|
|
|
|
|
"//全局设置,行运行一次,为后续准备\n",
|
|
|
|
|
"//#r \"nuget:Microsoft.Net.Http.Headers,8.0.12\"\n",
|
|
|
|
|
"//#r \"nuget:Microsoft.Extensions.Http,8.0.1\"\n",
|
|
|
|
|
"//#r \"nuget:System.Net.Http.Json,8.0.1\"\n",
|
|
|
|
|
"//#r \"nuget:Microsoft.Extensions.DependencyInjection,8.0.1\"\n",
|
|
|
|
|
"#r \"./Publish/HttpClientStudy.Model/HttpClientStudy.Model.dll\"\n",
|
|
|
|
|
"#r \"./Publish/HttpClientStudy.Core/HttpClientStudy.Core.dll\"\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"global using System;\n",
|
|
|
|
|
"global using System.Collections;\n",
|
|
|
|
|
"global using System.Collections.Concurrent;\n",
|
|
|
|
|
"global using System.Linq;\n",
|
|
|
|
|
"global using System.Linq.Expressions;\n",
|
|
|
|
|
"global using System.Threading;\n",
|
|
|
|
|
"global using System.Threading.Tasks;\n",
|
|
|
|
|
"global using System.Net.Http;\n",
|
|
|
|
|
"//System.Net.Http.Json 包含处理json的扩展方法,方便处理请求和影响中的json数据\n",
|
|
|
|
|
"global using System.Net.Http.Json;\n",
|
|
|
|
|
"global using Microsoft.Extensions.DependencyInjection;\n",
|
|
|
|
|
"global using Microsoft.Extensions.DependencyInjection.Extensions;\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"global using HttpClientStudy.Config;\n",
|
|
|
|
|
"global using HttpClientStudy.Model;\n",
|
|
|
|
|
"global using HttpClientStudy.Core;\n",
|
|
|
|
|
"global using HttpClientStudy.Core.Utilities;\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"//全局变量\n",
|
|
|
|
|
"var webApiBaseUrl = WebApiConfigManager.GetWebApiConfig().BaseUrl;\n",
|
|
|
|
|
"var workDir = Environment.CurrentDirectory;\n",
|
|
|
|
|
"var fullPath = System.IO.Path.GetFullPath(\"./Publish/HttpClientStudy.WebApp/HttpClientStudy.WebApp.exe\", workDir);\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"//全局共享静态 HttpClient 对象\n",
|
|
|
|
|
"public static HttpClient SharedClient = new HttpClient(new SocketsHttpHandler(){ PooledConnectionIdleTimeout = TimeSpan.FromSeconds(30)})\n",
|
|
|
|
|
"{\n",
|
|
|
|
|
" BaseAddress = new Uri(WebApiConfigManager.GetWebApiConfig().BaseUrl),\n",
|
|
|
|
|
"};\n",
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"data": {
|
|
|
|
|
"text/markdown": [
|
|
|
|
|
"## 初始化\n",
|
|
|
|
|
"这是全局共用文件,包括Nuget包引用、全局类库引用、全局文件引用、全局命名空间引用、全局变量、全局方法、全局类定义等功能。\n",
|
|
|
|
|
"\n",
|
|
|
|
|
"//启动已发布的WebApi项目\n",
|
|
|
|
|
"{\n",
|
|
|
|
|
" Console.WriteLine(\"启动WebApi项目\");\n",
|
|
|
|
|
" var startMessage = AppUtility.RunWebApiExeFile(fullPath);\n",
|
|
|
|
|
" Console.WriteLine(startMessage);\n",
|
|
|
|
|
"}"
|
|
|
|
|
"在业务笔记中引用,执行其它单元格之前先执行一次。"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"output_type": "display_data"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"data": {
|
|
|
|
|
"text/html": [
|
|
|
|
|
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.Extensions.DependencyInjection, 9.0.3</span></li><li><span>Microsoft.Extensions.Http, 9.0.3</span></li><li><span>Microsoft.Extensions.Http.Polly, 9.0.3</span></li><li><span>Microsoft.Extensions.Logging, 9.0.3</span></li><li><span>Microsoft.Extensions.Logging.Console, 9.0.3</span></li><li><span>Microsoft.Net.Http.Headers, 9.0.3</span></li><li><span>Polly, 8.5.2</span></li><li><span>Refit, 8.0.0</span></li><li><span>Refit.HttpClientFactory, 8.0.0</span></li><li><span>System.Net.Http.Json, 9.0.3</span></li></ul></div></div>"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"output_type": "display_data"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"配置文件根目录:d:\\软件项目\\学习项目\\HttpClientStudy\\Docs\\Publish\\HttpClientStudy.Core\n",
|
|
|
|
|
"配置文件根目录:d:\\软件项目\\学习项目\\HttpClientStudy\\Docs\\Publish\\HttpClientStudy.Core\n",
|
|
|
|
|
"启动WebApi项目...\n",
|
|
|
|
|
"程序[d:\\软件项目\\学习项目\\HttpClientStudy\\Docs\\Publish\\HttpClientStudy.WebApp\\HttpClientStudy.WebApp.exe]已在新的命令行窗口执行。如果未出现新命令行窗口,可能是程序错误造成窗口闪现!\n",
|
|
|
|
|
"已启动WebApi项目,保持窗口打开状态!\n",
|
|
|
|
|
"初始化完成!\n"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"//初始化:必须先执行一次\n",
|
|
|
|
|
"#!import ./ini.ipynb"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -261,7 +254,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"execution_count": 49,
|
|
|
|
|
"metadata": {
|
|
|
|
|
"dotnet_interactive": {
|
|
|
|
|
"language": "csharp"
|
|
|
|
@ -273,7 +266,15 @@
|
|
|
|
|
"languageId": "polyglot-notebook"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"Index\r\n"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"//Get 请求\n",
|
|
|
|
|
"{\n",
|
|
|
|
@ -308,7 +309,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"execution_count": 50,
|
|
|
|
|
"metadata": {
|
|
|
|
|
"dotnet_interactive": {
|
|
|
|
|
"language": "csharp"
|
|
|
|
@ -320,7 +321,128 @@
|
|
|
|
|
"languageId": "polyglot-notebook"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"data": {
|
|
|
|
|
"text/html": [
|
|
|
|
|
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>HttpClientStudy.Model.Account</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Id</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre>Hello</pre></div></td></tr><tr><td>Password</td><td><div class=\"dni-plaintext\"><pre>pwd</pre></div></td></tr><tr><td>Role</td><td><div class=\"dni-plaintext\"><pre>Devlopment</pre></div></td></tr></tbody></table></div></details><style>\r\n",
|
|
|
|
|
".dni-code-hint {\r\n",
|
|
|
|
|
" font-style: italic;\r\n",
|
|
|
|
|
" overflow: hidden;\r\n",
|
|
|
|
|
" white-space: nowrap;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
".dni-treeview {\r\n",
|
|
|
|
|
" white-space: nowrap;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
".dni-treeview td {\r\n",
|
|
|
|
|
" vertical-align: top;\r\n",
|
|
|
|
|
" text-align: start;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"details.dni-treeview {\r\n",
|
|
|
|
|
" padding-left: 1em;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"table td {\r\n",
|
|
|
|
|
" text-align: start;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"table tr { \r\n",
|
|
|
|
|
" vertical-align: top; \r\n",
|
|
|
|
|
" margin: 0em 0px;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"table tr td pre \r\n",
|
|
|
|
|
"{ \r\n",
|
|
|
|
|
" vertical-align: top !important; \r\n",
|
|
|
|
|
" margin: 0em 0px !important;\r\n",
|
|
|
|
|
"} \r\n",
|
|
|
|
|
"table th {\r\n",
|
|
|
|
|
" text-align: start;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"</style>"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"output_type": "display_data"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"data": {
|
|
|
|
|
"text/html": [
|
|
|
|
|
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>HttpClientStudy.Model.Account</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Id</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre>Hello</pre></div></td></tr><tr><td>Password</td><td><div class=\"dni-plaintext\"><pre>pwd</pre></div></td></tr><tr><td>Role</td><td><div class=\"dni-plaintext\"><pre>Devlopment</pre></div></td></tr></tbody></table></div></details><style>\r\n",
|
|
|
|
|
".dni-code-hint {\r\n",
|
|
|
|
|
" font-style: italic;\r\n",
|
|
|
|
|
" overflow: hidden;\r\n",
|
|
|
|
|
" white-space: nowrap;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
".dni-treeview {\r\n",
|
|
|
|
|
" white-space: nowrap;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
".dni-treeview td {\r\n",
|
|
|
|
|
" vertical-align: top;\r\n",
|
|
|
|
|
" text-align: start;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"details.dni-treeview {\r\n",
|
|
|
|
|
" padding-left: 1em;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"table td {\r\n",
|
|
|
|
|
" text-align: start;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"table tr { \r\n",
|
|
|
|
|
" vertical-align: top; \r\n",
|
|
|
|
|
" margin: 0em 0px;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"table tr td pre \r\n",
|
|
|
|
|
"{ \r\n",
|
|
|
|
|
" vertical-align: top !important; \r\n",
|
|
|
|
|
" margin: 0em 0px !important;\r\n",
|
|
|
|
|
"} \r\n",
|
|
|
|
|
"table th {\r\n",
|
|
|
|
|
" text-align: start;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"</style>"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"output_type": "display_data"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"data": {
|
|
|
|
|
"text/html": [
|
|
|
|
|
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>HttpClientStudy.Model.Account</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Id</td><td><div class=\"dni-plaintext\"><pre>0</pre></div></td></tr><tr><td>Name</td><td><div class=\"dni-plaintext\"><pre><null></pre></div></td></tr><tr><td>Password</td><td><div class=\"dni-plaintext\"><pre><null></pre></div></td></tr><tr><td>Role</td><td><div class=\"dni-plaintext\"><pre>Dev</pre></div></td></tr></tbody></table></div></details><style>\r\n",
|
|
|
|
|
".dni-code-hint {\r\n",
|
|
|
|
|
" font-style: italic;\r\n",
|
|
|
|
|
" overflow: hidden;\r\n",
|
|
|
|
|
" white-space: nowrap;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
".dni-treeview {\r\n",
|
|
|
|
|
" white-space: nowrap;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
".dni-treeview td {\r\n",
|
|
|
|
|
" vertical-align: top;\r\n",
|
|
|
|
|
" text-align: start;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"details.dni-treeview {\r\n",
|
|
|
|
|
" padding-left: 1em;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"table td {\r\n",
|
|
|
|
|
" text-align: start;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"table tr { \r\n",
|
|
|
|
|
" vertical-align: top; \r\n",
|
|
|
|
|
" margin: 0em 0px;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"table tr td pre \r\n",
|
|
|
|
|
"{ \r\n",
|
|
|
|
|
" vertical-align: top !important; \r\n",
|
|
|
|
|
" margin: 0em 0px !important;\r\n",
|
|
|
|
|
"} \r\n",
|
|
|
|
|
"table th {\r\n",
|
|
|
|
|
" text-align: start;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"</style>"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"output_type": "display_data"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"/*\n",
|
|
|
|
|
" 方式一:使用 System.Net.Http.Json\n",
|
|
|
|
@ -378,7 +500,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"execution_count": 51,
|
|
|
|
|
"metadata": {
|
|
|
|
|
"dotnet_interactive": {
|
|
|
|
|
"language": "csharp"
|
|
|
|
@ -390,7 +512,16 @@
|
|
|
|
|
"languageId": "polyglot-notebook"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"Post Success\n",
|
|
|
|
|
"添加成功\n"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"//不带请求体\n",
|
|
|
|
|
"{\n",
|
|
|
|
@ -438,7 +569,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"execution_count": 52,
|
|
|
|
|
"metadata": {
|
|
|
|
|
"dotnet_interactive": {
|
|
|
|
|
"language": "csharp"
|
|
|
|
@ -450,7 +581,55 @@
|
|
|
|
|
"languageId": "polyglot-notebook"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"{\"data\":{\"id\":2,\"name\":\"管理员02\",\"password\":\"123456\",\"role\":\"Admin\"},\"code\":1,\"message\":\"成功\"}\r\n"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"data": {
|
|
|
|
|
"text/html": [
|
|
|
|
|
"<details open=\"open\" class=\"dni-treeview\"><summary><span class=\"dni-code-hint\"><code>HttpClientStudy.Model.BaseResult`1[HttpClientStudy.Model.Account]</code></span></summary><div><table><thead><tr></tr></thead><tbody><tr><td>Data</td><td><div class=\"dni-plaintext\"><pre>HttpClientStudy.Model.BaseResult`1[HttpClientStudy.Model.Account]</pre></div></td></tr><tr><td>Code</td><td><div class=\"dni-plaintext\"><pre>1</pre></div></td></tr><tr><td>Message</td><td><div class=\"dni-plaintext\"><pre>成功</pre></div></td></tr><tr><td>Data</td><td><div class=\"dni-plaintext\"><pre>HttpClientStudy.Model.BaseResult`1[HttpClientStudy.Model.Account]</pre></div></td></tr></tbody></table></div></details><style>\r\n",
|
|
|
|
|
".dni-code-hint {\r\n",
|
|
|
|
|
" font-style: italic;\r\n",
|
|
|
|
|
" overflow: hidden;\r\n",
|
|
|
|
|
" white-space: nowrap;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
".dni-treeview {\r\n",
|
|
|
|
|
" white-space: nowrap;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
".dni-treeview td {\r\n",
|
|
|
|
|
" vertical-align: top;\r\n",
|
|
|
|
|
" text-align: start;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"details.dni-treeview {\r\n",
|
|
|
|
|
" padding-left: 1em;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"table td {\r\n",
|
|
|
|
|
" text-align: start;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"table tr { \r\n",
|
|
|
|
|
" vertical-align: top; \r\n",
|
|
|
|
|
" margin: 0em 0px;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"table tr td pre \r\n",
|
|
|
|
|
"{ \r\n",
|
|
|
|
|
" vertical-align: top !important; \r\n",
|
|
|
|
|
" margin: 0em 0px !important;\r\n",
|
|
|
|
|
"} \r\n",
|
|
|
|
|
"table th {\r\n",
|
|
|
|
|
" text-align: start;\r\n",
|
|
|
|
|
"}\r\n",
|
|
|
|
|
"</style>"
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"metadata": {},
|
|
|
|
|
"output_type": "display_data"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"/* Put请求, 一般是添加或修改资源:需要数据。\n",
|
|
|
|
|
" 这里故意使用查询,没有资源:\n",
|
|
|
|
@ -488,7 +667,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"execution_count": 53,
|
|
|
|
|
"metadata": {
|
|
|
|
|
"dotnet_interactive": {
|
|
|
|
|
"language": "csharp"
|
|
|
|
@ -500,7 +679,15 @@
|
|
|
|
|
"languageId": "polyglot-notebook"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"无响应体\r\n"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"//Head请求,借助SendAsync方法\n",
|
|
|
|
|
"{\n",
|
|
|
|
@ -532,7 +719,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"execution_count": 54,
|
|
|
|
|
"metadata": {
|
|
|
|
|
"dotnet_interactive": {
|
|
|
|
|
"language": "csharp"
|
|
|
|
@ -544,7 +731,15 @@
|
|
|
|
|
"languageId": "polyglot-notebook"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"{\"data\":{\"id\":1,\"name\":\"Patch更新\",\"password\":\"123456\",\"role\":\"Admin\"},\"code\":1,\"message\":\"成功\"}\r\n"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"//Patch请求\n",
|
|
|
|
|
"{\n",
|
|
|
|
@ -581,7 +776,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"execution_count": 55,
|
|
|
|
|
"metadata": {
|
|
|
|
|
"dotnet_interactive": {
|
|
|
|
|
"language": "csharp"
|
|
|
|
@ -593,7 +788,15 @@
|
|
|
|
|
"languageId": "polyglot-notebook"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"{\"data\":1,\"code\":1,\"message\":\"成功\"}\r\n"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"//Delete 删除资源\n",
|
|
|
|
|
"{\n",
|
|
|
|
@ -622,7 +825,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"execution_count": 56,
|
|
|
|
|
"metadata": {
|
|
|
|
|
"dotnet_interactive": {
|
|
|
|
|
"language": "csharp"
|
|
|
|
@ -634,7 +837,15 @@
|
|
|
|
|
"languageId": "polyglot-notebook"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"{\"data\":\"简单OPTIONS请求\",\"code\":1,\"message\":\"成功\"}\r\n"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"//Options 预检请求\n",
|
|
|
|
|
"{\n",
|
|
|
|
@ -666,7 +877,7 @@
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"cell_type": "code",
|
|
|
|
|
"execution_count": null,
|
|
|
|
|
"execution_count": 57,
|
|
|
|
|
"metadata": {
|
|
|
|
|
"dotnet_interactive": {
|
|
|
|
|
"language": "csharp"
|
|
|
|
@ -678,7 +889,15 @@
|
|
|
|
|
"languageId": "polyglot-notebook"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"outputs": [],
|
|
|
|
|
"outputs": [
|
|
|
|
|
{
|
|
|
|
|
"name": "stdout",
|
|
|
|
|
"output_type": "stream",
|
|
|
|
|
"text": [
|
|
|
|
|
"我是请求内容\r\n"
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"source": [
|
|
|
|
|
"//trace 服务器已设置专门中间件支持所有接口的Trace请求\n",
|
|
|
|
|
"{\n",
|
|
|
|
|