TypeError:请求路径包含googleapis中的未转义字符

时间:2018-07-24 12:16:40

标签: node.js google-api escaping google-api-nodejs-client

我收到一个TypeError: Request path contains unescaped characters的任何googleapis请求,其中包含一个额外的选项,例如ValueRenderOption。 当我执行像/v4/spreadsheets/1DhEUa96iqyQSaj1152jLZFiBH_aaVLOhk-sLEwe30y8/values/Sheet1!A1

这样的简单请求时,还可以

但是 请求网址如下所示:/v4/spreadsheets/.../values/Sheet1!A1?valueRenderOption=FORMATTED_VALUE 给我这样的错误:

17:34:26 0|application | appending row
17:34:26 0|application | You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
17:34:26 0|application | TypeError: Request path contains unescaped characters
17:34:26 0|application | at new ClientRequest (_http_client.js:52:11)
17:34:26 0|application | at Object.exports.request (http.js:31:10)
17:34:26 0|application | at Object.exports.request (https.js:199:15)
17:34:26 0|application | at Writable.RedirectableRequest._performRequest (/var/www/www.application.com/app/node_modules/google-auth-library/node_modules/follow-redirects/index.js:132:24)
17:34:26 0|application | at Writable.RedirectableRequest (/var/www/www.application.com/app/node_modules/google-auth-library/node_modules/follow-redirects/index.js:55:8)
17:34:26 0|application | at Object.wrappedProtocol.request (/var/www/www.application.com/app/node_modules/google-auth-library/node_modules/follow-redirects/index.js:269:14)
17:34:26 0|application | at dispatchHttpRequest (/var/www/www.application.com/app/node_modules/google-auth-library/node_modules/axios/lib/adapters/http.js:141:25)
17:34:26 0|application | at httpAdapter (/var/www/www.application.com/app/node_modules/google-auth-library/node_modules/axios/lib/adapters/http.js:18:10)
17:34:26 0|application | at dispatchRequest (/var/www/www.application.com/app/node_modules/google-auth-library/node_modules/axios/lib/core/dispatchRequest.js:59:10)
17:34:26 0|application | at process._tickDomainCallback (internal/process/next_tick.js:135:7)

测试的版本::: 32.0.0、28.0.0和28.0.1 节点版本6.11.1 npm 3.10.10

0 个答案:

没有答案