HttpPluginInterface.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. //------------------------------------------------------------------------------
  2. // 此代码版权(除特别声明或在XREF结尾的命名空间的代码)归作者本人若汝棋茗所有
  3. // 源代码使用协议遵循本仓库的开源协议及附加协议,若本仓库没有设置,则按MIT开源协议授权
  4. // CSDN博客:https://blog.csdn.net/qq_40374647
  5. // 哔哩哔哩视频:https://space.bilibili.com/94253567
  6. // Gitee源代码仓库:https://gitee.com/RRQM_Home
  7. // Github源代码仓库:https://github.com/RRQM
  8. // API首页:https://www.yuque.com/rrqm/touchsocket/index
  9. // 交流QQ群:234762506
  10. // 感谢您的下载和使用
  11. //------------------------------------------------------------------------------
  12. //------------------------------------------------------------------------------
  13. using System.Threading.Tasks;
  14. using TouchSocket.Core;
  15. using TouchSocket.Sockets;
  16. namespace TouchSocket.Http
  17. {
  18. /// <summary>
  19. /// Http接口
  20. /// </summary>
  21. public interface IHttpPlugin : IPlugin
  22. {
  23. /// <summary>
  24. /// 在收到Delete时
  25. /// </summary>
  26. /// <param name="client"></param>
  27. /// <param name="e"></param>
  28. [AsyncRaiser]
  29. void OnDelete(ITcpClientBase client, HttpContextEventArgs e);
  30. /// <summary>
  31. /// 在收到Delete时
  32. /// </summary>
  33. /// <param name="client"></param>
  34. /// <param name="e"></param>
  35. /// <returns></returns>
  36. Task OnDeleteAsync(ITcpClientBase client, HttpContextEventArgs e);
  37. /// <summary>
  38. /// 在收到Get时
  39. /// </summary>
  40. /// <param name="client"></param>
  41. /// <param name="e"></param>
  42. [AsyncRaiser]
  43. void OnGet(ITcpClientBase client, HttpContextEventArgs e);
  44. /// <summary>
  45. /// 在收到Get时
  46. /// </summary>
  47. /// <param name="client"></param>
  48. /// <param name="e"></param>
  49. /// <returns></returns>
  50. Task OnGetAsync(ITcpClientBase client, HttpContextEventArgs e);
  51. /// <summary>
  52. /// 在收到Post时
  53. /// </summary>
  54. /// <param name="client"></param>
  55. /// <param name="e"></param>
  56. [AsyncRaiser]
  57. void OnPost(ITcpClientBase client, HttpContextEventArgs e);
  58. /// <summary>
  59. /// 在收到Post时
  60. /// </summary>
  61. /// <param name="client"></param>
  62. /// <param name="e"></param>
  63. /// <returns></returns>
  64. Task OnPostAsync(ITcpClientBase client, HttpContextEventArgs e);
  65. /// <summary>
  66. /// 在收到Put时
  67. /// </summary>
  68. /// <param name="client"></param>
  69. /// <param name="e"></param>
  70. [AsyncRaiser]
  71. void OnPut(ITcpClientBase client, HttpContextEventArgs e);
  72. /// <summary>
  73. /// 在收到Put时
  74. /// </summary>
  75. /// <param name="client"></param>
  76. /// <param name="e"></param>
  77. /// <returns></returns>
  78. Task OnPutAsync(ITcpClientBase client, HttpContextEventArgs e);
  79. /// <summary>
  80. /// 在收到其他Http请求时
  81. /// </summary>
  82. /// <param name="client"></param>
  83. /// <param name="e"></param>
  84. [AsyncRaiser]
  85. void OnReceivedOtherHttpRequest(ITcpClientBase client, HttpContextEventArgs e);
  86. /// <summary>
  87. /// 在收到其他Http请求时
  88. /// </summary>
  89. /// <param name="client"></param>
  90. /// <param name="e"></param>
  91. /// <returns></returns>
  92. Task OnReceivedOtherHttpRequestAsync(ITcpClientBase client, HttpContextEventArgs e);
  93. }
  94. }