Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data: undefined #41

Open
janiscp opened this issue Aug 13, 2018 · 4 comments
Open

data: undefined #41

janiscp opened this issue Aug 13, 2018 · 4 comments

Comments

@janiscp
Copy link

janiscp commented Aug 13, 2018

What is wrong why does data is always undefined?

image

@thgreasi
Copy link
Collaborator

Hi, any further details on your setup that you could share? Package version, API version and the methods that this happens?

@razzy777
Copy link

razzy777 commented May 3, 2019

Hi, I have the same problem. For me it runs on the API version 2.19 and I use the latest version of recurly-js. It happens regardless the methods I use. Maybe the data response is not parsed the right way?

@geoffdutton
Copy link

According to our recurly rep, starting with Api v2.10 the responses are different, and some endpoints have changed.

@janiscp What endpoint is that screenshot hitting, and what’s the value of the “x-Api-version” header?

@razzy777
Copy link

razzy777 commented May 5, 2019

I solved it, but thank you!
Apparently you need to add to accept the response format in the header.
Keep in mind to parse the buffer response to string

headers: {
    'Accept': 'application/xml; charset=utf-8'
  }
  let buf = Buffer.from(data.data)
  console.log(buf.toString())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants