HttpResponseInfo.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. using System;
  2. using System.IO;
  3. using System.Net;
  4. using System.Net.Http.Headers;
  5. namespace MediaBrowser.Common.Net
  6. {
  7. /// <summary>
  8. /// Class HttpResponseInfo.
  9. /// </summary>
  10. public class HttpResponseInfo : IDisposable
  11. {
  12. #pragma warning disable CS1591
  13. public HttpResponseInfo()
  14. {
  15. }
  16. public HttpResponseInfo(HttpResponseHeaders headers, HttpContentHeaders contentHeader)
  17. {
  18. Headers = headers;
  19. ContentHeaders = contentHeader;
  20. }
  21. #pragma warning restore CS1591
  22. #pragma warning restore SA1600
  23. /// <summary>
  24. /// Gets or sets the type of the content.
  25. /// </summary>
  26. /// <value>The type of the content.</value>
  27. public string ContentType { get; set; }
  28. /// <summary>
  29. /// Gets or sets the response URL.
  30. /// </summary>
  31. /// <value>The response URL.</value>
  32. public string ResponseUrl { get; set; }
  33. /// <summary>
  34. /// Gets or sets the content.
  35. /// </summary>
  36. /// <value>The content.</value>
  37. public Stream Content { get; set; }
  38. /// <summary>
  39. /// Gets or sets the status code.
  40. /// </summary>
  41. /// <value>The status code.</value>
  42. public HttpStatusCode StatusCode { get; set; }
  43. /// <summary>
  44. /// Gets or sets the temp file path.
  45. /// </summary>
  46. /// <value>The temp file path.</value>
  47. public string TempFilePath { get; set; }
  48. /// <summary>
  49. /// Gets or sets the length of the content.
  50. /// </summary>
  51. /// <value>The length of the content.</value>
  52. public long? ContentLength { get; set; }
  53. /// <summary>
  54. /// Gets or sets the headers.
  55. /// </summary>
  56. /// <value>The headers.</value>
  57. public HttpResponseHeaders Headers { get; set; }
  58. /// <summary>
  59. /// Gets or sets the content headers.
  60. /// </summary>
  61. /// <value>The content headers.</value>
  62. public HttpContentHeaders ContentHeaders { get; set; }
  63. /// <inheritdoc />
  64. public void Dispose()
  65. {
  66. // backwards compatibility
  67. }
  68. }
  69. }