main
bicijinlian
parent 1b28caab2b
commit 20000e83cc

@ -61,7 +61,7 @@
{
"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>"
"<div><div></div><div></div><div><strong>Installed Packages</strong><ul><li><span>Microsoft.Extensions.DependencyInjection, 9.0.4</span></li><li><span>Microsoft.Extensions.Http, 9.0.4</span></li><li><span>Microsoft.Extensions.Http.Polly, 9.0.4</span></li><li><span>Microsoft.Extensions.Logging, 9.0.4</span></li><li><span>Microsoft.Extensions.Logging.Console, 9.0.4</span></li><li><span>Microsoft.Net.Http.Headers, 9.0.4</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.4</span></li></ul></div></div>"
]
},
"metadata": {},
@ -71,10 +71,10 @@
"name": "stdout",
"output_type": "stream",
"text": [
"配置文件根目录:d:\\软件项目\\学习项目\\HttpClientStudy\\Docs\\Publish\\HttpClientStudy.Core\n",
"配置文件根目录:d:\\软件项目\\学习项目\\HttpClientStudy\\Docs\\Publish\\HttpClientStudy.Core\n",
"配置文件根目录:c:\\Users\\ruyu\\Desktop\\HttpClientStudy\\Docs\\Publish\\HttpClientStudy.Core\n",
"配置文件根目录:c:\\Users\\ruyu\\Desktop\\HttpClientStudy\\Docs\\Publish\\HttpClientStudy.Core\n",
"启动WebApi项目...\n",
"程序[d:\\软件项目\\学习项目\\HttpClientStudy\\Docs\\Publish\\HttpClientStudy.WebApp\\HttpClientStudy.WebApp.exe]已在新的命令行窗口执行。如果未出现新命令行窗口,可能是程序错误造成窗口闪现!\n",
"程序[c:\\Users\\ruyu\\Desktop\\HttpClientStudy\\Docs\\Publish\\HttpClientStudy.WebApp\\HttpClientStudy.WebApp.exe]已在新的命令行窗口执行。如果未出现新命令行窗口,可能是程序错误造成窗口闪现!\n",
"已启动WebApi项目,保持窗口打开状态!\n",
"初始化完成!\n"
]
@ -456,7 +456,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
@ -468,13 +468,37 @@
"languageId": "polyglot-notebook"
}
},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\"data\":\"id=1&name=管理员01\",\"code\":1,\"message\":\"成功\"}\r\n"
]
}
],
"source": [
"/*\n",
" \n",
" FormUrlEncoded 提交数据 \n",
"*/\n",
"{\n",
" //设置数据项\n",
" var urlEncodedData = new List<KeyValuePair<string,string>>()\n",
" {\n",
" new KeyValuePair<string,string>(key:\"id\",value:\"1\"),\n",
" new KeyValuePair<string,string>(key:\"name\",value:\"管理员01\"),\n",
" };\n",
"\n",
" //FormUrlEncodedContent对象\n",
" var formContent = new FormUrlEncodedContent(urlEncodedData);\n",
" \n",
" // 发送POST请求\n",
" var response = await SharedClient.PostAsync(\"api/AdvancedGet/PostFormData\", formContent);\n",
" \n",
" // 读取响应内容\n",
" string responseString = await response.Content.ReadAsStringAsync();\n",
" \n",
" Console.WriteLine(responseString);\n",
"}"
]
},
@ -491,7 +515,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {
"dotnet_interactive": {
"language": "csharp"
@ -514,7 +538,7 @@
],
"source": [
"/*\n",
" \n",
" 普通文本方式提交数据\n",
"*/\n",
"{\n",
" var requestContent = new StringContent(\"我是请求体第一段内容\", Encoding.UTF8, \"text/plain\");\n",

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

@ -1 +0,0 @@
Start-Process -FilePath "dotnet.exe" -ArgumentList ".\Publish/HttpClientStudy.WebApi/HttpClientStudy.WebApi.dll"
Loading…
Cancel
Save