summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Core/Messaging/Channel.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2013-01-13 17:00:58 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2013-01-13 17:00:58 -0800
commit56916052cb61a48a85c5920f266766cfc937ece4 (patch)
tree372b8aeeae54e3bf268a482272819d17b3ab048d /src/DotNetOpenAuth.Core/Messaging/Channel.cs
parente117dedb1c2de355dae0bb3eedaa7b06deb0770e (diff)
downloadDotNetOpenAuth-56916052cb61a48a85c5920f266766cfc937ece4.zip
DotNetOpenAuth-56916052cb61a48a85c5920f266766cfc937ece4.tar.gz
DotNetOpenAuth-56916052cb61a48a85c5920f266766cfc937ece4.tar.bz2
DNOA.OAuth project now builds.
Diffstat (limited to 'src/DotNetOpenAuth.Core/Messaging/Channel.cs')
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/Channel.cs20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/Channel.cs b/src/DotNetOpenAuth.Core/Messaging/Channel.cs
index 9d55e78..7eadecd 100644
--- a/src/DotNetOpenAuth.Core/Messaging/Channel.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/Channel.cs
@@ -558,15 +558,17 @@ namespace DotNetOpenAuth.Messaging {
/// </summary>
/// <param name="httpMethod">The HTTP method.</param>
/// <returns><c>true</c> if the HTTP method is supposed to have an entity; <c>false</c> otherwise.</returns>
- protected static bool HttpMethodHasEntity(string httpMethod) {
- if (string.Equals(httpMethod, "GET", StringComparison.Ordinal) ||
- string.Equals(httpMethod, "HEAD", StringComparison.Ordinal) ||
- string.Equals(httpMethod, "DELETE", StringComparison.Ordinal) ||
- string.Equals(httpMethod, "OPTIONS", StringComparison.Ordinal)) {
+ protected static bool HttpMethodHasEntity(HttpMethod httpMethod) {
+ Requires.NotNull(httpMethod, "httpMethod");
+
+ if (httpMethod == HttpMethod.Get ||
+ httpMethod == HttpMethod.Head ||
+ httpMethod == HttpMethod.Delete ||
+ httpMethod == HttpMethod.Options) {
return false;
- } else if (string.Equals(httpMethod, "POST", StringComparison.Ordinal) ||
- string.Equals(httpMethod, "PUT", StringComparison.Ordinal) ||
- string.Equals(httpMethod, "PATCH", StringComparison.Ordinal)) {
+ } else if (httpMethod == HttpMethod.Post ||
+ httpMethod == HttpMethod.Put ||
+ string.Equals(httpMethod.Method, "PATCH", StringComparison.Ordinal)) {
return true;
} else {
throw ErrorUtilities.ThrowArgumentNamed("httpMethod", MessagingStrings.UnsupportedHttpVerb, httpMethod);
@@ -1041,7 +1043,7 @@ namespace DotNetOpenAuth.Messaging {
if (requestMessageWithBinaryData != null && requestMessageWithBinaryData.SendAsMultipart) {
var content = new MultipartFormDataContent();
foreach (var part in requestMessageWithBinaryData.BinaryData) {
- content.Add(part);
+ content.Add(part.Value, part.Key);
}
// When sending multi-part, all data gets send as multi-part -- even the non-binary data.