HttpResponseInfo.cs 2.1 KB

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