Skip to content

Commit

Permalink
fix: sample app TypeError (#1257)
Browse files Browse the repository at this point in the history
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

Fixes #1246 🦕
  • Loading branch information
ZiweiZhao authored May 7, 2020
1 parent ad02efb commit 1ac424e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samples/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1ac424e

Please sign in to comment.