IHttpListenerResponse.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System.IO;
  2. using System.Net;
  3. using System.Text;
  4. namespace WebDAVSharp.Server.Adapters
  5. {
  6. /// <summary>
  7. /// This is an interface-version of the parts of
  8. /// <see cref="HttpListenerResponse" /> that
  9. /// the
  10. /// <see cref="WebDavServer" /> requires to operator.
  11. /// </summary>
  12. /// <remarks>
  13. /// The main purpose of this interface is to facilitate unit-testing.
  14. /// </remarks>
  15. public interface IHttpListenerResponse : IAdapter<HttpListenerResponse>
  16. {
  17. /// <summary>
  18. /// Gets or sets the HTTP status code to be returned to the client.
  19. /// </summary>
  20. /// <value>
  21. /// The status code.
  22. /// </value>
  23. int StatusCode { get; set; }
  24. /// <summary>
  25. /// Gets or sets a text description of the HTTP <see cref="StatusCode">status code</see> returned to the client.
  26. /// </summary>
  27. /// <value>
  28. /// The status description.
  29. /// </value>
  30. string StatusDescription { get; set; }
  31. /// <summary>
  32. /// Gets a <see cref="Stream" /> object to which a response can be written.
  33. /// </summary>
  34. /// <value>
  35. /// The output stream.
  36. /// </value>
  37. Stream OutputStream { get; }
  38. /// <summary>
  39. /// Gets or sets the <see cref="Encoding" /> for this response's <see cref="OutputStream" />.
  40. /// </summary>
  41. /// <value>
  42. /// The content encoding.
  43. /// </value>
  44. Encoding ContentEncoding { get; set; }
  45. /// <summary>
  46. /// Gets or sets the number of bytes in the body data included in the response.
  47. /// </summary>
  48. /// <value>
  49. /// The content length64.
  50. /// </value>
  51. long ContentLength64 { get; set; }
  52. /// <summary>
  53. /// Sends the response to the client and releases the resources held by the adapted
  54. /// <see cref="HttpListenerResponse" /> instance.
  55. /// </summary>
  56. void Close();
  57. /// <summary>
  58. /// Appends a value to the specified HTTP header to be sent with the response.
  59. /// </summary>
  60. /// <param name="name">The name of the HTTP header to append the <paramref name="value" /> to.</param>
  61. /// <param name="value">The value to append to the <paramref name="name" /> header.</param>
  62. void AppendHeader(string name, string value);
  63. }
  64. }