diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-09-10 22:18:15 -0700 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-09-10 22:18:15 -0700 |
commit | f6d28fb14c91c97f6cc8b85c442987082997866a (patch) | |
tree | c517bf2a41709319255b5b5312f3fc56c06bff6e /src/DotNetOAuth/Messaging/Response.cs | |
parent | d33318e787968182f95c183d1891c9a7d59a3b69 (diff) | |
download | DotNetOpenAuth-f6d28fb14c91c97f6cc8b85c442987082997866a.zip DotNetOpenAuth-f6d28fb14c91c97f6cc8b85c442987082997866a.tar.gz DotNetOpenAuth-f6d28fb14c91c97f6cc8b85c442987082997866a.tar.bz2 |
Code coverage work is as complete as our implementation will currently allow.
Diffstat (limited to 'src/DotNetOAuth/Messaging/Response.cs')
-rw-r--r-- | src/DotNetOAuth/Messaging/Response.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/DotNetOAuth/Messaging/Response.cs b/src/DotNetOAuth/Messaging/Response.cs index 81089ed..8a7c2e1 100644 --- a/src/DotNetOAuth/Messaging/Response.cs +++ b/src/DotNetOAuth/Messaging/Response.cs @@ -6,6 +6,7 @@ namespace DotNetOAuth.Messaging {
using System;
+ using System.IO;
using System.Net;
using System.Web;
@@ -33,6 +34,19 @@ namespace DotNetOAuth.Messaging { }
/// <summary>
+ /// Initializes a new instance of the <see cref="Response"/> class
+ /// based on the contents of an <see cref="HttpWebResponse"/>.
+ /// </summary>
+ /// <param name="response">The <see cref="HttpWebResponse"/> to clone.</param>
+ internal Response(HttpWebResponse response) {
+ this.Status = response.StatusCode;
+ this.Headers = response.Headers;
+ using (StreamReader reader = new StreamReader(response.GetResponseStream())) {
+ this.Body = reader.ReadToEnd();
+ }
+ }
+
+ /// <summary>
/// Gets the headers that must be included in the response to the user agent.
/// </summary>
/// <remarks>
|