I have a below code which is giving me response but when i try to access properties of the response, i am getting 'undefined'
const request = require('request-promise');
const option= {
method: 'GET',
uri: 'urihere',
qs: {
q: 'Mark'
},
json: true,
resolveWithFullResponse: true,
headers: {
'User-Agent': 'requestXYZPromise',
'Authorization': ''
}
}
request(option)
.then(response => {
})
.catch(error => {
})
What's wrong here? Please suggest.
Update - Response data. I am trying to get 'score'
{
"responseHeader":{
"ist":"json",
"version":"1.0"}},
"response":{"score":2,"start":0,"maxScore":18.9204}
}