文件名称:sync-curl:nodejs的同步curl获取
文件大小:1.36MB
文件格式:ZIP
更新时间:2024-05-19 00:05:15
JavaScript
sync-curl 可以进行同步http请求,并支持gbk编码。 Installation npm install sync-curl Usage request(method, url, options) e.g. GET request without options var request = require('sync-curl'); var res = request('GET', 'url', {encode:'utf8'}); var body = res.body.toString(); console.log(body); Param method: request type url: request link options: [encode] 目标地址的编码,输出会转换为utf8 [encoding] request original param. gbk grab