diff --git a/SlnMesnac.TouchSocket/ApiServer.cs b/SlnMesnac.TouchSocket/ApiServer.cs index 1d4f4f9..7ffbcf7 100644 --- a/SlnMesnac.TouchSocket/ApiServer.cs +++ b/SlnMesnac.TouchSocket/ApiServer.cs @@ -2,12 +2,14 @@ using System.Collections.Generic; using System.Linq; using System.Text; +using Microsoft.AspNetCore.Http.Features; using Microsoft.Extensions.Logging; using SlnMesnac.Model.domain; using SlnMesnac.Repository.service; using SlnMesnac.Repository.service.LogImpl; using SlnMesnac.Repository.service.ScanLog; using TouchSocket.Core; +using TouchSocket.Http; using TouchSocket.Rpc; using TouchSocket.WebApi; @@ -37,6 +39,22 @@ namespace SlnMesnac.TouchSocket + + [EnableCors("cors")] + [WebApi(HttpMethodType.POST)] + + public string Test(IWebApiCallContext callContext) + { + //http内容 + var httpContext = callContext.HttpContext; + + //http请求 + var request = httpContext.Request; + + var str = request.GetBody(); + return str; + } + [EnableCors("cors")] [WebApi(HttpMethodType.POST)]