HttpResponseInfo.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using System.Collections.Generic;
  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 Dictionary<string, string> Headers { get; set; }
  47. public HttpResponseInfo()
  48. {
  49. Headers = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
  50. }
  51. public void Dispose()
  52. {
  53. // Only IDisposable for backwards compatibility
  54. }
  55. }
  56. }