IRequest.cs 2.2 KB

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