HttpResponseInfo.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. /// <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 HttpResponseHeaders Headers { get; set; }
  47. public HttpResponseInfo()
  48. {
  49. }
  50. public HttpResponseInfo(HttpResponseHeaders headers)
  51. {
  52. Headers = headers;
  53. }
  54. public void Dispose()
  55. {
  56. // Only IDisposable for backwards compatibility
  57. }
  58. }
  59. }