New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

net-helper

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

net-helper

方便的使用http的GET/POST/PUT/DELETE

latest
Source
npmnpm
Version
1.0.8
Version published
Maintainers
1
Created
Source

easily use http restful API

  方便快捷的使用http的GET/POST/PUT/DELETE
  安装方法: npm install net-helper -S
  // 使用demo
  const shttp = require('net-helper').shttp;
  shttp
    .post('http://www.baidu.com')
    //.attach({ file: 'c:/desktop/test.png' })//上传的文件
    .query({ name: 'xxx', password: 'yyy' })
    .send({ email: 'xxxx' })
    .end(function(err, res, headers){
      if(err) {
        console.log(err.message);
      } else {
        console.log(headers);
        console.log(res);
      }
    });

使用方法介绍:

  • get() get请求
  • post() post请求
  • patch() patch请求
  • put() put请求
  • delete() delete请求
  • header() 设置请求头(可以设置表单文件的提交方式)
  • attach() 上传文件
  • query() 设置search字符串
  • send() 设置请求的body数据(options.json一定为true!!!)
  • end() 发送请求,返回请求结果,同样接受回调函数参数
  • getHTML() 获取网页

Keywords

net

FAQs

Package last updated on 28 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts