IHttpListenerRequest.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. using System;
  2. using System.Collections.Specialized;
  3. using System.IO;
  4. using System.Net;
  5. using System.Text;
  6. namespace WebDAVSharp.Server.Adapters
  7. {
  8. /// <summary>
  9. /// This is an interface-version of the parts of
  10. /// <see cref="HttpListenerRequest" /> that
  11. /// the
  12. /// <see cref="WebDavServer" /> requires to operator.
  13. /// </summary>
  14. /// <remarks>
  15. /// The main purpose of this interface is to facilitate unit-testing.
  16. /// </remarks>
  17. public interface IHttpListenerRequest : IAdapter<HttpListenerRequest>
  18. {
  19. /// <summary>
  20. /// Gets the client IP address and port number from which the request originated.
  21. /// </summary>
  22. /// <value>
  23. /// The remote end point.
  24. /// </value>
  25. IPEndPoint RemoteEndPoint { get; }
  26. /// <summary>
  27. /// Gets the <see cref="Uri" /> object requested by the client.
  28. /// </summary>
  29. /// <value>
  30. /// The URL.
  31. /// </value>
  32. Uri Url { get; }
  33. /// <summary>
  34. /// Gets the HTTP method specified by the client.
  35. /// </summary>
  36. /// <value>
  37. /// The HTTP method.
  38. /// </value>
  39. string HttpMethod { get; }
  40. /// <summary>
  41. /// Gets the collection of header name/value pairs sent in the request.
  42. /// </summary>
  43. /// <value>
  44. /// The headers.
  45. /// </value>
  46. NameValueCollection Headers { get; }
  47. /// <summary>
  48. /// Gets a <see cref="Stream" /> that contains the body data sent by the client.
  49. /// </summary>
  50. /// <value>
  51. /// The input stream.
  52. /// </value>
  53. Stream InputStream { get; }
  54. /// <summary>
  55. /// Gets the content <see cref="Encoding" /> that can be used with data sent with the request.
  56. /// </summary>
  57. /// <value>
  58. /// The content encoding.
  59. /// </value>
  60. Encoding ContentEncoding { get; }
  61. /// <summary>
  62. /// Gets the length of the body data included in the request.
  63. /// </summary>
  64. /// <value>
  65. /// The content length64.
  66. /// </value>
  67. long ContentLength64 { get; }
  68. }
  69. }