Forum Settings
Forums
New
Oct 3, 2016 5:06 AM
#1

Offline
Aug 2010
228
I am seeing placeholder values when I send an HTTP request from my nodejs app to the MAL api. The values are the same no matter what user I enter and they have no score information attached.

When I use 'curl http://myanimelist.net/malappinfo.php?u=emchamp&status=all&type=anime' I get the correct values. I have the relevant part of my nodejs code linked below:

http://pastebin.com/DYRGJDEf

Any idea why I am getting bogus values from nodejs when curl is returning the right XML data?
Reply Disabled for Non-Club Members
Oct 4, 2016 11:28 AM
#2
MALClient dev

Offline
Oct 2015
203
Maybe it's required to use https? Or maybe node sets some odd contenttype?

This is my c# code (which is working):
                    Request =
                        WebRequest.Create(
                            Uri.EscapeUriString(
                                $"https://myanimelist.net/malappinfo.php?u={source}&status=all&type={type}"));
                    Request.ContentType = "application/x-www-form-urlencoded";
                    Request.Method = "GET";

I made Windows 10 and Android MALClient apps! Source!
Oct 4, 2016 4:20 PM
#3

Offline
Aug 2010
228
It ended up being a bug in my NodeJS code, I wasn't using body-parser to grab the username variable correctly so it was passing in an undefined parameter for user and getting a default list it seems.
Reply Disabled for Non-Club Members

More topics from this board

» Which endpoints support nsfw query param?

crimson-megumin - Apr 21

2 by crimson-megumin »»
40 minutes ago

» Cant build the URL

tamcio_ - Dec 4, 2022

4 by Jotzy »»
Yesterday, 4:35 AM

» I made a new anime recommendation system for MyAnimeList

Asudox - Mar 21

4 by Asudox »»
Apr 11, 2:58 PM

» API Rate Limit?

Asudox - Jan 23

7 by pepeefirat »»
Mar 23, 3:57 AM

» Some Animes Missing on API Reponse

Niccol0 - Jan 26

3 by ZeroCrystal »»
Mar 15, 3:44 PM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login