File: Tasks\Http\HttpResponseMessageForStatusCode.cs
Web Access
Project: src\src\sdk\src\WebSdk\Publish\Tasks\Microsoft.NET.Sdk.Publish.Tasks.csproj (Microsoft.NET.Sdk.Publish.Tasks)
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Net;

namespace Microsoft.NET.Sdk.Publish.Tasks;

internal class HttpResponseMessageForStatusCode(HttpStatusCode statusCode) : IHttpResponse
{
    /// <inheritdoc/>
    public HttpStatusCode StatusCode { get; private set; } = statusCode;

    /// <inheritdoc/>
    public Task<Stream?> GetResponseBodyAsync()
    {
        return System.Threading.Tasks.Task.FromResult<Stream?>(new MemoryStream());
    }

    /// <inheritdoc/>
    public IEnumerable<string> GetHeader(string name)
    {
        return [];
    }
}