Compare commits

...

2 commits

Author SHA1 Message Date
uwaa
4903b6320a Update HttpRequest.cs 2024-11-13 01:39:23 +00:00
uwaa
38251d1328 Create NotAcceptable.cs 2024-11-13 01:39:19 +00:00
2 changed files with 12 additions and 2 deletions

View file

@ -100,8 +100,7 @@ public sealed class HttpRequest
throw new RequestParseException("Invalid initial header");
//Method
HttpMethod method;
if (!Enum.TryParse(parts[0], true, out method))
if (!Enum.TryParse(parts[0], true, out HttpMethod method))
throw new RequestParseException("Unknown HTTP method");
Method = method;

View file

@ -0,0 +1,11 @@
namespace Uwaa.HTTP.Responses;
/// <summary>
/// An error caused by a client requesting an unavailable format.
/// </summary>
public class NotAcceptable : HttpResponse
{
public NotAcceptable(HttpContent? body = null) : base(406, "Not Acceptable", body)
{
}
}