summaryrefslogtreecommitdiffstats
path: root/src/DotNetOAuth/StandardWebRequestHandler.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-09-21 21:38:41 -0700
committerAndrew <andrewarnott@gmail.com>2008-09-21 21:38:41 -0700
commitf80ac82be5e9432806ce35b7025b007246d74147 (patch)
tree9e194bfa753d03ea4deb2a02ffcd7f7db35cad0d /src/DotNetOAuth/StandardWebRequestHandler.cs
parent2c381fbe2d2598e9549f5646d7bac40e49803760 (diff)
downloadDotNetOpenAuth-f80ac82be5e9432806ce35b7025b007246d74147.zip
DotNetOpenAuth-f80ac82be5e9432806ce35b7025b007246d74147.tar.gz
DotNetOpenAuth-f80ac82be5e9432806ce35b7025b007246d74147.tar.bz2
Adding the binding elements necessary for basic OAuth functionality.
Diffstat (limited to 'src/DotNetOAuth/StandardWebRequestHandler.cs')
-rw-r--r--src/DotNetOAuth/StandardWebRequestHandler.cs60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/DotNetOAuth/StandardWebRequestHandler.cs b/src/DotNetOAuth/StandardWebRequestHandler.cs
deleted file mode 100644
index d56562b..0000000
--- a/src/DotNetOAuth/StandardWebRequestHandler.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-//-----------------------------------------------------------------------
-// <copyright file="StandardWebRequestHandler.cs" company="Andrew Arnott">
-// Copyright (c) Andrew Arnott. All rights reserved.
-// </copyright>
-//-----------------------------------------------------------------------
-
-namespace DotNetOAuth {
- using System;
- using System.IO;
- using System.Net;
- using DotNetOAuth.Messaging;
-
- /// <summary>
- /// The default handler for transmitting <see cref="HttpWebRequest"/> instances
- /// and returning the responses.
- /// </summary>
- internal class StandardWebRequestHandler : IWebRequestHandler {
- #region IWebRequestHandler Members
-
- /// <summary>
- /// Prepares a POST <see cref="HttpWebRequest"/> and returns the request stream
- /// for writing out the POST entity data.
- /// </summary>
- /// <param name="request">The <see cref="HttpWebRequest"/> that should contain the entity.</param>
- /// <returns>The stream the caller should write out the entity data to.</returns>
- public TextWriter GetRequestStream(HttpWebRequest request) {
- if (request == null) {
- throw new ArgumentNullException("request");
- }
-
- try {
- return new StreamWriter(request.GetRequestStream());
- } catch (WebException ex) {
- throw new ProtocolException(MessagingStrings.ErrorInRequestReplyMessage, ex);
- }
- }
-
- /// <summary>
- /// Processes an <see cref="HttpWebRequest"/> and converts the
- /// <see cref="HttpWebResponse"/> to a <see cref="Response"/> instance.
- /// </summary>
- /// <param name="request">The <see cref="HttpWebRequest"/> to handle.</param>
- /// <returns>An instance of <see cref="Response"/> describing the response.</returns>
- public Response GetResponse(HttpWebRequest request) {
- if (request == null) {
- throw new ArgumentNullException("request");
- }
-
- try {
- using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) {
- return new Response(response);
- }
- } catch (WebException ex) {
- throw new ProtocolException(MessagingStrings.ErrorInRequestReplyMessage, ex);
- }
- }
-
- #endregion
- }
-}