설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

APIRequest.cs 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System.Collections.Generic;
  2. using System.Net.Http;
  3. namespace LrGetToken
  4. {
  5. /// <summary>
  6. /// API请求类
  7. /// </summary>
  8. public class APIRequest
  9. {
  10. private string _path = "";
  11. /// <summary>
  12. /// 请求路径
  13. /// </summary>
  14. public string Path
  15. {
  16. get
  17. {
  18. return _path.TrimStart('/').TrimEnd('/');
  19. }
  20. set
  21. {
  22. _path = value;
  23. }
  24. }
  25. ///// <summary>
  26. ///// 请求Method
  27. ///// </summary>
  28. public HttpMethod Method = HttpMethod.Get;
  29. ///// <summary>
  30. ///// 请求ContentType,默认为 application/json
  31. ///// </summary>
  32. public string ContentType = "application/json";
  33. /// <summary>
  34. /// Param 参数
  35. /// </summary>
  36. public IDictionary<string, string> Params = new Dictionary<string, string>();
  37. /// <summary>
  38. /// 附加的Http Header
  39. /// </summary>
  40. public IDictionary<string, string> Header = new Dictionary<string, string>();
  41. /// <summary>
  42. /// 请求体
  43. /// </summary>
  44. public object Body { get; set; }
  45. /// <summary>
  46. /// 上传文件的路径
  47. /// </summary>
  48. public string File { get; set; }
  49. }
  50. }