elsa-core/src/modules/Elsa.Http/Contracts/IHttpContentParser.cs
Sipke Schoorstra c63369b567 Add system namespaces
For some reason my tooling no longer sees the global usings.
2023-10-20 09:50:57 +02:00

29 lines
945 B
C#

using System;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
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(string contentType);
/// <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(Stream content, Type? returnType, CancellationToken cancellationToken);
}