xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

auto convert cURL to Fetch All In One

auto convert cURL to Fetch All In One

curl post json

curl 'http://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=633a31f6-7f9c-4bc4-97a0-0ec1eefa5898' \
   -H 'Content-Type: application/json' \
   -d '
   {
        "msgtype": "text",
        "text": {
            "content": "hello world"
        }
   }'

https://kigiri.github.io/fetch/

fetch post json

fetch("http://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=633a31f6-7f9c-4bc4-97a0-0ec1eefa5898", {
  body: "\n   {\n        "msgtype": "text",\n        "text": {\n            "content": "hello world"\n        }\n   }",
  headers: {
    "Content-Type": "application/json"
  },
  method: "POST"
})

const obj =  {
  "msgtype": "text",
   "text": {
       "content": "hello world",
    },
};

fetch("http://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=633a31f6-7f9c-4bc4-97a0-0ec1eefa5898", {
  // body: JSON.stringify(obj, null, 4),
  body: JSON.stringify(obj),
  headers: {
    "Content-Type": "application/json"
  },
  method: "POST",
})

https://curl.trillworks.com/

https://stackoverflow.com/questions/56847902/converting-curl-to-fetch

(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!

refs



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @ 2021-03-31 11:56  xgqfrms  阅读(116)  评论(6编辑  收藏  举报