IRequest.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using Microsoft.AspNetCore.Http;
  6. namespace MediaBrowser.Model.Services
  7. {
  8. public interface IRequest
  9. {
  10. HttpResponse Response { get; }
  11. /// <summary>
  12. /// The name of the service being called (e.g. Request DTO Name)
  13. /// </summary>
  14. string OperationName { get; set; }
  15. /// <summary>
  16. /// The Verb / HttpMethod or Action for this request
  17. /// </summary>
  18. string Verb { get; }
  19. /// <summary>
  20. /// The request ContentType
  21. /// </summary>
  22. string ContentType { get; }
  23. bool IsLocal { get; }
  24. string UserAgent { get; }
  25. /// <summary>
  26. /// The expected Response ContentType for this request
  27. /// </summary>
  28. string ResponseContentType { get; set; }
  29. /// <summary>
  30. /// Attach any data to this request that all filters and services can access.
  31. /// </summary>
  32. Dictionary<string, object> Items { get; }
  33. IHeaderDictionary Headers { get; }
  34. IQueryCollection QueryString { get; }
  35. string RawUrl { get; }
  36. string AbsoluteUri { get; }
  37. /// <summary>
  38. /// The Remote Ip as reported by X-Forwarded-For, X-Real-IP or Request.UserHostAddress
  39. /// </summary>
  40. string RemoteIp { get; }
  41. /// <summary>
  42. /// The value of the Authorization Header used to send the Api Key, null if not available
  43. /// </summary>
  44. string Authorization { get; }
  45. string[] AcceptTypes { get; }
  46. string PathInfo { get; }
  47. Stream InputStream { get; }
  48. long ContentLength { get; }
  49. /// <summary>
  50. /// The value of the Referrer, null if not available
  51. /// </summary>
  52. Uri UrlReferrer { get; }
  53. }
  54. public interface IHttpFile
  55. {
  56. string Name { get; }
  57. string FileName { get; }
  58. long ContentLength { get; }
  59. string ContentType { get; }
  60. Stream InputStream { get; }
  61. }
  62. public interface IRequiresRequest
  63. {
  64. IRequest Request { get; set; }
  65. }
  66. }