Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions src/Ramstack.HtmxToolkit/Configuration/HtmxHttpVerb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ namespace Ramstack.HtmxToolkit.Configuration;
/// <summary>
/// Defines the HTTP methods that can be used in HTMX configuration.
/// </summary>
/// <remarks>
/// <para>
/// <c>HEAD</c> and <c>OPTIONS</c> have no <c>hx-*</c> attribute and are available only through <c>htmx.ajax</c>.
/// </para>
/// <para>
/// There are no members for <c>CONNECT</c> and <c>TRACE</c>, because browsers do not allow requests with these methods.
/// </para>
/// </remarks>
public enum HtmxHttpVerb
{
/// <summary>
Expand Down Expand Up @@ -32,24 +40,12 @@ public enum HtmxHttpVerb
/// </summary>
Delete,

/// <summary>
/// The <c>CONNECT</c> method establishes a tunnel to the server
/// identified by the target resource.
/// </summary>
Connect,

/// <summary>
/// The <c>OPTIONS</c> method describes the communication options
/// for the target resource.
/// </summary>
Options,

/// <summary>
/// The <c>TRACE</c> method performs a message loop-back test
/// along the path to the target resource.
/// </summary>
Trace,

/// <summary>
/// The <c>PATCH</c> method applies partial modifications to a resource.
/// </summary>
Expand Down
4 changes: 0 additions & 4 deletions src/Ramstack.HtmxToolkit/Internal/EnumHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ or HtmxHttpVerb.Head
or HtmxHttpVerb.Post
or HtmxHttpVerb.Put
or HtmxHttpVerb.Delete
or HtmxHttpVerb.Connect
or HtmxHttpVerb.Options
or HtmxHttpVerb.Trace
or HtmxHttpVerb.Patch);

return value switch
Expand All @@ -128,9 +126,7 @@ or HtmxHttpVerb.Trace
HtmxHttpVerb.Post => "post",
HtmxHttpVerb.Put => "put",
HtmxHttpVerb.Delete => "delete",
HtmxHttpVerb.Connect => "connect",
HtmxHttpVerb.Options => "options",
HtmxHttpVerb.Trace => "trace",
_ => "patch"
};
}
Expand Down
2 changes: 0 additions & 2 deletions tests/Ramstack.HtmxToolkit.Tests/Internal/EnumHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ public void ParseHtmxSwap_ReturnsNull_WithoutStyle(string? expression) =>
[TestCase(HtmxHttpVerb.Post, "post")]
[TestCase(HtmxHttpVerb.Put, "put")]
[TestCase(HtmxHttpVerb.Delete, "delete")]
[TestCase(HtmxHttpVerb.Connect, "connect")]
[TestCase(HtmxHttpVerb.Options, "options")]
[TestCase(HtmxHttpVerb.Trace, "trace")]
[TestCase(HtmxHttpVerb.Patch, "patch")]
public void GetHttpVerbValue_ReturnsExpectedString(HtmxHttpVerb value, string expected) =>
Assert.That(value.GetHttpVerbValue(), Is.EqualTo(expected));
Expand Down
Loading