HttpResponseInfo.cs 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. #pragma warning disable SA1600
  14. public HttpResponseInfo()
  15. {
  16. }
  17. public HttpResponseInfo(HttpResponseHeaders headers, HttpContentHeaders contentHeader)
  18. {
  19. Headers = headers;
  20. ContentHeaders = contentHeader;
  21. }
  22. #pragma warning restore CS1591
  23. #pragma warning restore SA1600
  24. /// <summary>
  25. /// Gets or sets the type of the content.
  26. /// </summary>
  27. /// <value>The type of the content.</value>
  28. public string ContentType { get; set; }
  29. /// <summary>
  30. /// Gets or sets the response URL.
  31. /// </summary>
  32. /// <value>The response URL.</value>
  33. public string ResponseUrl { get; set; }
  34. /// <summary>
  35. /// Gets or sets the content.
  36. /// </summary>
  37. /// <value>The content.</value>
  38. public Stream Content { get; set; }
  39. /// <summary>
  40. /// Gets or sets the status code.
  41. /// </summary>
  42. /// <value>The status code.</value>
  43. public HttpStatusCode StatusCode { get; set; }
  44. /// <summary>
  45. /// Gets or sets the temp file path.
  46. /// </summary>
  47. /// <value>The temp file path.</value>
  48. public string TempFilePath { get; set; }
  49. /// <summary>
  50. /// Gets or sets the length of the content.
  51. /// </summary>
  52. /// <value>The length of the content.</value>
  53. public long? ContentLength { get; set; }
  54. /// <summary>
  55. /// Gets or sets the headers.
  56. /// </summary>
  57. /// <value>The headers.</value>
  58. public HttpResponseHeaders Headers { get; set; }
  59. /// <summary>
  60. /// Gets or sets the content headers.
  61. /// </summary>
  62. /// <value>The content headers.</value>
  63. public HttpContentHeaders ContentHeaders { get; set; }
  64. /// <inheritdoc />
  65. public void Dispose()
  66. {
  67. // backwards compatibility
  68. }
  69. }
  70. }