1.0.2 • Published 7 years ago

ceshuhttp v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

ceshuHttp

服务器端发起Http请求

作者信息

  • 作者:策叔
  • 版本:1.0.2
  • 名称:ceshuHttp
  • 邮箱:ceshukeji@gmail.com

功能特点

  • 支持服务端发起GET、POST、PUT、DELETE请求

使用方法

npm i ceshuhttp -S

app.js:

const ceshuHttp = require('ceshuHttp')
const $http = ceshuHttp.server

let httpConfig = {
    // 请求地址
	url: "http://...",
	// 请求方式:get、post、put、delete
	method: "post", 
	// 设置请求头
	headers: {
		"key": "val"     
	},
	// 提交数据
	data: {
		"title": "标题...",
		"content": "内容...",
	}
}

$http(httpConfig).then(data => {
	console.log(data)
}).catch(err => {
	console.log(err)
})

运行: node app

如果你喜欢ceshuChat,可以点击右上角的 star,想实时关注进度,可以点击右上角的 watch

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago