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

Replace dependency on RequestStream in Request.Body with Stream #2512

Merged
merged 1 commit into from
Aug 4, 2016
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
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