HTTP/MiniHTTP/Responses/Redirect.cs
2024-10-25 05:00:22 +01:00

19 lines
416 B
C#

namespace MiniHTTP.Responses;
/// <summary>
/// A response redirecting the request to another location.
/// </summary>
public class Redirect : HttpResponse
{
public string Location;
public Redirect(string location) : base(301, "Redirect")
{
Location = location;
}
public override IEnumerable<(string, string)> GetHeaders()
{
yield return ("Location", Location);
}
}