本文整理汇总了C#中IHttpRequest.GetRawBody方法的典型用法代码示例。如果您正苦于以下问题:C# IHttpRequest.GetRawBody方法的具体用法?C# IHttpRequest.GetRawBody怎么用?C# IHttpRequest.GetRawBody使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IHttpRequest
的用法示例。
在下文中一共展示了IHttpRequest.GetRawBody方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RequestFilter
public void RequestFilter(IHttpRequest req, IHttpResponse res, object requestDto)
{
if (string.IsNullOrWhiteSpace(Name) || string.IsNullOrWhiteSpace(Method)) return;
var hub = GlobalHost.ConnectionManager.GetHubContext(Name);
if (hub != null)
{
hub.Clients.All.Invoke(Method,
new
{
Time = DateTime.Now.ToString("G"),
Data = req.HttpMethod + " " + req.RawUrl + " " + req.GetRawBody()
});
}
}
示例2: Ingest
public BulkOperationsResponse Ingest(IOpenSearchableElasticType type, IHttpRequest request)
{
OpenSearchEngine ose = type.GetOpenSearchEngine(new NameValueCollection());
IOpenSearchEngineExtension osee = ose.GetExtensionByContentTypeAbility(request.ContentType);
if (osee == null)
throw new NotImplementedException(string.Format("No OpenSearch extension found for reading {0}", Request.ContentType));
MemoryOpenSearchResponse payload = new MemoryOpenSearchResponse(request.GetRawBody(), request.ContentType);
IOpenSearchResultCollection results = osee.ReadNative(payload);
return Ingest(type, results);
}