Skip to content

Returns undefined in React App #2

@wolfgang-terzer

Description

@wolfgang-terzer

Hi,
I am trying to use the SDK in my react app. I use it in that way:

const IC = require('iatacodes');
const ic = new IC(iataCodesApiKey);

ic.api('autocomplete', {query: 'vie'}, function(error, response) {
    console.log(error);
    console.log(response);
  });

It returns "Undefined".
Error Text:

Error: empty response
    at Request._callback (index.js:36)
    at self.callback (request.js:220)
    at Request.push../node_modules/events/events.js.EventEmitter.emit (events.js:72)
    at Request.push../node_modules/request/request.js.Request.onRequestError (request.js:963)
    at push../node_modules/stream-http/lib/request.js.module.exports.push../node_modules/events/events.js.EventEmitter.emit (events.js:72)
    at request.js:162

What do I do wrong? Or has it an error?

Thanks for response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions