elsa-core/src/modules/Elsa.Http/Contracts/IHttpContentParser.cs
Sipke Schoorstra d7320e1a5d Add HTTP file download activity and supporting classes
This commit adds a new activity, DownloadHttpFile, which provides the capability to download a file from a specified URL. It introduces supporting classes like HttpFile, FileHttpContentParser, and several extensions methods related to handling HTTP headers and file content. It also contains necessary updates in existing classes to accommodate the new file-download feature.
2024-06-13 22:13:53 +02:00

25 lines
842 B
C#

using Elsa.Http.Contexts;
namespace Elsa.Http.Contracts;
/// <summary>
/// A strategy that reads a <see cref="HttpResponseMessage"/> of a given content type.
/// </summary>
public interface IHttpContentParser
{
/// <summary>
/// The priority of the parser as compared to other parsers.
/// The higher the number, the higher priority.
/// </summary>
int Priority { get; }
/// <summary>
/// Returns a value indicating whether this reader supports the specified content type.
/// </summary>
bool GetSupportsContentType(HttpResponseParserContext context);
/// <summary>
/// Reads the specified <c>stream</c> and returns a parsed object of the specified type. If no type is specified, a string is returned.
/// </summary>
Task<object> ReadAsync(HttpResponseParserContext context);
}