HttpResponseInfo.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. /// <summary>
  48. /// Gets or sets the content headers.
  49. /// </summary>
  50. /// <value>The content headers.</value>
  51. public HttpContentHeaders ContentHeaders { get; set; }
  52. public HttpResponseInfo()
  53. {
  54. }
  55. public HttpResponseInfo(HttpResponseHeaders headers, HttpContentHeaders contentHeader)
  56. {
  57. Headers = headers;
  58. ContentHeaders = contentHeader;
  59. }
  60. public void Dispose()
  61. {
  62. // Only IDisposable for backwards compatibility
  63. }
  64. }
  65. }