REST.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //get请求 获取全部
  2. fetch("https://web2023.fmode.cn/parse/classes/WyContact?", {
  3. "headers": {
  4. "accept": "*/*",
  5. "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6,zh-TW;q=0.5",
  6. "if-none-match": "W/\"f9-PTTxnfLa7XLaADJ/4V+GIZ9nEgc\"",
  7. "x-parse-application-id": "dev"
  8. },
  9. "referrer": "http://127.0.0.1:4040/",
  10. "referrerPolicy": "strict-origin-when-cross-origin",
  11. "body": null,
  12. "method": "GET",
  13. "mode": "cors",
  14. "credentials": "omit"
  15. });
  16. //post 创建
  17. fetch("https://web2023.fmode.cn/parse/classes/WyContact", {
  18. "headers": {
  19. "accept": "*/*",
  20. "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6,zh-TW;q=0.5",
  21. "content-type": "text/plain;charset=UTF-8",
  22. "x-parse-application-id": "dev"
  23. },
  24. "referrer": "http://127.0.0.1:4040/",
  25. "referrerPolicy": "strict-origin-when-cross-origin",
  26. "body": "{\"name\":\"Rose\"}",
  27. "method": "POST",
  28. "mode": "cors",
  29. "credentials": "omit"
  30. });
  31. //put 修改
  32. fetch("https://web2023.fmode.cn/parse/classes/WyContact/68q4JeSDGh", {
  33. "headers": {
  34. "accept": "*/*",
  35. "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6,zh-TW;q=0.5",
  36. "content-type": "text/plain;charset=UTF-8",
  37. "x-parse-application-id": "dev"
  38. },
  39. "referrer": "http://127.0.0.1:4040/",
  40. "referrerPolicy": "strict-origin-when-cross-origin",
  41. "body": "{\"name\":\"July\"}",
  42. "method": "PUT",
  43. "mode": "cors",
  44. "credentials": "omit"
  45. });
  46. //delete
  47. fetch("https://web2023.fmode.cn/parse/classes/WyContact/68q4JeSDGh", {
  48. "headers": {
  49. "accept": "*/*",
  50. "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6,zh-TW;q=0.5",
  51. "x-parse-application-id": "dev"
  52. },
  53. "referrer": "http://127.0.0.1:4040/",
  54. "referrerPolicy": "strict-origin-when-cross-origin",
  55. "body": null,
  56. "method": "DELETE",
  57. "mode": "cors",
  58. "credentials": "omit"
  59. });