From 4b2e604a2e4b85df558d6c8519956f45a1fac5b6 Mon Sep 17 00:00:00 2001 From: Ziwei Zhao Date: Mon, 4 May 2020 11:02:20 -0400 Subject: [PATCH] fix: sample app TypeError App sample has error: TypeError: The `GET` method cannot be used with a body This pull request is to update the body to an json response option --- samples/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/app.js b/samples/app.js index 810e81b44..f7f3cfa99 100644 --- a/samples/app.js +++ b/samples/app.js @@ -31,7 +31,7 @@ const DISCOVERY_URL = 'https://www.googleapis.com/discovery/v1/apis'; app.get('/', async (req, res) => { // This outgoing HTTP request should be captured by Trace try { - const {body} = await got(DISCOVERY_URL, {json: true}); + const {body} = await got(DISCOVERY_URL, {responseType: 'json'}); const names = body.items.map(item => item.name); res.status(200).send(names.join('\n')).end(); } catch (err) {