Make available raw content
This commit is contained in:
parent
6f5e2c6beb
commit
cbdc3e4375
|
|
@ -106,7 +106,11 @@ namespace Elsa.Activities.Http.Middleware
|
|||
if (readContent)
|
||||
{
|
||||
var targetType = await activityWrapper.EvaluatePropertyValueAsync(x => x.TargetType, cancellationToken);
|
||||
inputModel = inputModel with { Body = await contentParser.ParseAsync(request, targetType, cancellationToken) };
|
||||
inputModel = inputModel with
|
||||
{
|
||||
RawBody = await request.ReadContentAsStringAsync(cancellationToken),
|
||||
Body = await contentParser.ParseAsync(request, targetType, cancellationToken)
|
||||
};
|
||||
}
|
||||
|
||||
var useDispatch = httpContext.Request.GetUseDispatch();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ using System.Collections.Generic;
|
|||
|
||||
namespace Elsa.Activities.Http.Models
|
||||
{
|
||||
public record HttpRequestModel(string Path, string Method, IDictionary<string, string> QueryString, IDictionary<string, string> Headers, object? Body = default)
|
||||
public record HttpRequestModel(string Path, string Method, IDictionary<string, string> QueryString, IDictionary<string, string> Headers, object? Body = default, string? RawBody = default)
|
||||
{
|
||||
public T GetBody<T>() => (T) Body!;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using System.Threading.Tasks;
|
|||
using Elsa.Activities.Http.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Elsa.Activities.Http.Parsers
|
||||
namespace Elsa.Activities.Http.Parsers.Request
|
||||
{
|
||||
public class FormHttpRequestBodyParser : IHttpRequestBodyParser
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using Elsa.Activities.Http.Services;
|
|||
using Elsa.Serialization;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Elsa.Activities.Http.Parsers
|
||||
namespace Elsa.Activities.Http.Parsers.Request
|
||||
{
|
||||
public class JsonHttpRequestBodyParser : IHttpRequestBodyParser
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue