2 Star 0 Fork 0

mirrors_WebReflection/json-post

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
ISC

json-post

How to post JSON in NodeJS.

You know those simplest things ever not properly documented online? That!

const jsonPOST = require('json-post');
// or import jsonPOST from 'json-post'

jsonPOST(
  'https://whatever:5000/seriously',
  {hello: 'world'}
  // optionally extra headers {...}
).then(
  console.info,
  console.error
);

That's literally it.

... and what about browsers ?

You can use this MDN fetch example to post JSON data.

ISC License Copyright (c) 2018, Andrea Giammarchi, @WebReflection Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

简介

How to post JSON in NodeJS 展开 收起
README
ISC
取消

发行版

暂无发行版

贡献者 (2)

全部

近期动态

接近5年前创建了仓库
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mirrors_WebReflection/json-post.git
git@gitee.com:mirrors_WebReflection/json-post.git
mirrors_WebReflection
json-post
json-post
master

搜索帮助