Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2512 from danbarua/master
Browse files Browse the repository at this point in the history
Replace dependency on RequestStream in Request.Body with Stream
  • Loading branch information
horsdal authored Aug 4, 2016
2 parents fc9cda6 + 90ae351 commit d76e7ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/Nancy/Request.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public Request(string method, string path, string scheme)
/// <param name="protocolVersion">The HTTP protocol version.</param>
public Request(string method,
Url url,
RequestStream body = null,
Stream body = null,
IDictionary<string, IEnumerable<string>> headers = null,
string ip = null,
X509Certificate certificate = null,
Expand Down Expand Up @@ -148,10 +148,10 @@ public string Path
public dynamic Query { get; set; }

/// <summary>
/// Gets a <see cref="RequestStream"/> that can be used to read the incoming HTTP body
/// Gets a <see cref="Stream"/> that can be used to read the incoming HTTP body
/// </summary>
/// <value>A <see cref="RequestStream"/> object representing the incoming HTTP body.</value>
public RequestStream Body { get; private set; }
/// <value>A <see cref="Stream"/> object representing the incoming HTTP body.</value>
public Stream Body { get; private set; }

/// <summary>
/// Gets the request cookies.
Expand Down
3 changes: 2 additions & 1 deletion test/Nancy.Tests.Functional/Modules/SerializerTestModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Globalization;
using Nancy.Extensions;
using Nancy.IO;
using Nancy.ModelBinding;

public class SerializerTestModule : NancyModule
Expand All @@ -25,7 +26,7 @@ public SerializerTestModule()

Post("/serializer/date", args =>
{
var s = this.Request.Body.AsString();
var s = ((RequestStream)this.Request.Body).AsString();
var model = this.Bind<FakeSerializerModel>();
return model;
});
Expand Down

0 comments on commit d76e7ef

Please sign in to comment.