将npm请求对象字符串-request.toString()转换为请求对象吗?

时间:2019-06-24 17:57:14

标签: npm request

我通过在请求对象上应用toString()将npm请求对象另存为字符串。我想将其解析回普通请求对象以进行调用。我无法将其解析为普通请求对象

//This is String request object when I console it. I want this below object/function back parsed as request object

function (uri, opts, callback) {
    var params = initParams(uri, opts, callback)

    var target = {}
    extend(true, target, options, params)

    target.pool = params.pool || options.pool

    if (verb) {
      target.method = verb.toUpperCase()
    }

    if (typeof requester === 'function') {
      method = requester
    }

    return method(target, target.callback)
  }

0 个答案:

没有答案