Ars
Ars

Reputation: 5

Get json respons from http get respons?

Please tell me how to get json response? I get base4 by example:

// Using Node.js 14.x +
// use "lib" package from npm
const lib = require('lib')({token: null /* link an account to create an auth token */});

// make API request
let result = await lib.http.request['@1.1.6'].get({
  url: null // required
});

https://autocode.com/lib/http/request/#get

Upvotes: 0

Views: 84

Answers (1)

Bánh Gạo
Bánh Gạo

Reputation: 16

Using axios package will be easier. It's default response type is json.

const axios = require('axios');
let result = await axios.get('your_url')
});

Upvotes: 0

Related Questions