2024-06-13 20:13:53 +00:00
|
|
|
using Elsa.Http.Contexts;
|
|
|
|
|
|
2024-10-14 19:27:11 +00:00
|
|
|
namespace Elsa.Http;
|
2023-01-16 18:42:45 +00:00
|
|
|
|
|
|
|
|
/// <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>
|
2024-06-13 20:13:53 +00:00
|
|
|
bool GetSupportsContentType(HttpResponseParserContext context);
|
2023-01-16 18:42:45 +00:00
|
|
|
|
|
|
|
|
/// <summary>
|
2023-09-19 20:42:53 +00:00
|
|
|
/// Reads the specified <c>stream</c> and returns a parsed object of the specified type. If no type is specified, a string is returned.
|
2023-01-16 18:42:45 +00:00
|
|
|
/// </summary>
|
2024-06-13 20:13:53 +00:00
|
|
|
Task<object> ReadAsync(HttpResponseParserContext context);
|
2023-01-16 18:42:45 +00:00
|
|
|
}
|