IRequest.cs 2.1 KB

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