const request = require('request');

class ReqClient {
    constructor() {

    }

    async reqFormData(params, url) {
        let options = {
            url: url,
            form: params
        };
        return new Promise(function (resolve, reject) {
            request.post(options, function (error, response, body) {
                if (error) {
                    reject(error);
                } else {
                    resolve(body);
                }
            });
        });
    }
}

module.exports = ReqClient;
