Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="TouchSocket.Http" Version="3.0.24" />
<PackageReference Include="TouchSocket.Http" Version="3.1.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ public static void Main(string[] args)
}
}

public partial class ApiServer : RpcServer
public partial class ApiServer : SingletonRpcServer
{
private HttpContent m_contentPlaintext = new StringHttpContent("Hello, World!", Encoding.UTF8, $"text/plain");
private readonly HttpContent m_contentPlaintext = new StringHttpContent("Hello, World!", Encoding.UTF8, $"text/plain");

public static MyJson MyJson { get; set; } = new MyJson() { Message = "Hello, World!" };

Expand All @@ -71,7 +71,7 @@ public async Task Plaintext(IWebApiCallContext callContext)
var response= callContext.HttpContext.Response;
response.SetStatus(200, "success");
response.Content= m_contentPlaintext;
await response.AnswerAsync();
await response.AnswerAsync().ConfigureAwait(false);
}

[Router("/json")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="TouchSocket.Hosting" Version="3.0.24" />
<PackageReference Include="TouchSocket.WebApi" Version="3.0.24" />
<PackageReference Include="TouchSocket.WebApi.Swagger" Version="3.0.24" />
<PackageReference Include="TouchSocket.Hosting" Version="3.1.0" />
<PackageReference Include="TouchSocket.WebApi" Version="3.1.0" />
<PackageReference Include="TouchSocket.WebApi.Swagger" Version="3.1.0" />
</ItemGroup>
</Project>
Loading