elsa-core/src/activities/Elsa.Activities.Http/Parsers/Response/PlainTextHttpResponseContentReader.cs
2021-12-20 16:40:06 +01:00

15 lines
587 B
C#

using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Elsa.Activities.Http.Services;
namespace Elsa.Activities.Http.Parsers.Response
{
public class PlainTextHttpResponseContentReader : IHttpResponseContentReader
{
public string Name => "Plain Text";
public int Priority => -1;
public bool GetSupportsContentType(string contentType) => true;
public async Task<object> ReadAsync(HttpResponseMessage response, object context, CancellationToken cancellationToken) => await response.Content.ReadAsStringAsync();
}
}