HttpResponseInfo.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. using System;
  2. using System.Collections.Specialized;
  3. using System.IO;
  4. using System.Net;
  5. namespace MediaBrowser.Common.Net
  6. {
  7. /// <summary>
  8. /// Class HttpResponseInfo
  9. /// </summary>
  10. public class HttpResponseInfo : IDisposable
  11. {
  12. /// <summary>
  13. /// Gets or sets the type of the content.
  14. /// </summary>
  15. /// <value>The type of the content.</value>
  16. public string ContentType { get; set; }
  17. /// <summary>
  18. /// Gets or sets the response URL.
  19. /// </summary>
  20. /// <value>The response URL.</value>
  21. public string ResponseUrl { get; set; }
  22. /// <summary>
  23. /// Gets or sets the content.
  24. /// </summary>
  25. /// <value>The content.</value>
  26. public Stream Content { get; set; }
  27. /// <summary>
  28. /// Gets or sets the status code.
  29. /// </summary>
  30. /// <value>The status code.</value>
  31. public HttpStatusCode StatusCode { get; set; }
  32. /// <summary>
  33. /// Gets or sets the temp file path.
  34. /// </summary>
  35. /// <value>The temp file path.</value>
  36. public string TempFilePath { get; set; }
  37. /// <summary>
  38. /// Gets or sets the length of the content.
  39. /// </summary>
  40. /// <value>The length of the content.</value>
  41. public long? ContentLength { get; set; }
  42. /// <summary>
  43. /// Gets or sets the headers.
  44. /// </summary>
  45. /// <value>The headers.</value>
  46. public NameValueCollection Headers { get; set; }
  47. private readonly IDisposable _disposable;
  48. public HttpResponseInfo(IDisposable disposable)
  49. {
  50. _disposable = disposable;
  51. }
  52. public HttpResponseInfo()
  53. {
  54. }
  55. public void Dispose()
  56. {
  57. if (_disposable != null)
  58. {
  59. _disposable.Dispose();
  60. }
  61. }
  62. }
  63. }