summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
diff options
context:
space:
mode:
authorMatt Hawley <matt@eworldui.net>2012-08-10 11:45:31 -0700
committerMatt Hawley <matt@eworldui.net>2012-08-10 11:45:31 -0700
commita759ad7ac6d3c15a680b9b7180a35a8375faa8ce (patch)
tree22bac102118beef083965082242c92c6b5d37176 /src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
parent2d24056882a645bc1ae519f0322d533d9bf86b96 (diff)
downloadDotNetOpenAuth-a759ad7ac6d3c15a680b9b7180a35a8375faa8ce.zip
DotNetOpenAuth-a759ad7ac6d3c15a680b9b7180a35a8375faa8ce.tar.gz
DotNetOpenAuth-a759ad7ac6d3c15a680b9b7180a35a8375faa8ce.tar.bz2
Adding PATCH and OPTION http verbs
Diffstat (limited to 'src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs')
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs b/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
index e821953..e213f01 100644
--- a/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
@@ -1443,6 +1443,10 @@ namespace DotNetOpenAuth.Messaging {
return HttpDeliveryMethods.DeleteRequest;
} else if (httpVerb == "HEAD") {
return HttpDeliveryMethods.HeadRequest;
+ } else if (httpVerb == "PATCH") {
+ return HttpDeliveryMethods.PatchRequest;
+ } else if (httpVerb == "OPTION") {
+ return HttpDeliveryMethods.OptionRequest;
} else {
throw ErrorUtilities.ThrowArgumentNamed("httpVerb", MessagingStrings.UnsupportedHttpVerb, httpVerb);
}
@@ -1452,7 +1456,7 @@ namespace DotNetOpenAuth.Messaging {
/// Gets the HTTP verb to use for a given <see cref="HttpDeliveryMethods"/> enum value.
/// </summary>
/// <param name="httpMethod">The HTTP method.</param>
- /// <returns>An HTTP verb, such as GET, POST, PUT, or DELETE.</returns>
+ /// <returns>An HTTP verb, such as GET, POST, PUT, DELETE, PATCH, or OPTION.</returns>
internal static string GetHttpVerb(HttpDeliveryMethods httpMethod) {
if ((httpMethod & HttpDeliveryMethods.HttpVerbMask) == HttpDeliveryMethods.GetRequest) {
return "GET";
@@ -1464,6 +1468,10 @@ namespace DotNetOpenAuth.Messaging {
return "DELETE";
} else if ((httpMethod & HttpDeliveryMethods.HttpVerbMask) == HttpDeliveryMethods.HeadRequest) {
return "HEAD";
+ } else if ((httpMethod & HttpDeliveryMethods.HttpVerbMask) == HttpDeliveryMethods.PatchRequest) {
+ return "PATCH";
+ } else if ((httpMethod & HttpDeliveryMethods.HttpVerbMask) == HttpDeliveryMethods.OptionRequest) {
+ return "OPTION";
} else if ((httpMethod & HttpDeliveryMethods.AuthorizationHeaderRequest) != 0) {
return "GET"; // if AuthorizationHeaderRequest is specified without an explicit HTTP verb, assume GET.
} else {