Skip to content
Advertisement

Why is my website throwing POST error in python?

I’m sending request to League of Legends API for JSON file. In 3 others tries it worked for me, but in last it doesn’t. I have no idea why and can’t find any mistakes.

My request for getting JSON file

JavaScript

My website function for return the results. Place, where is mistake, is highlighted with comment.

JavaScript

Last, but not least, my website form

JavaScript

PS: Added JSON file

JavaScript

Advertisement

Answer

The error does not lie exactly where you think it does.

JavaScript

The error is actually on the first line above (you can see it on your screenshot). You call the function challengerPlayers, but it is not defined (that’s exactly what the error message is telling you).

You should implement this function or fix the name in the function call.

By the way, you call a variable with the same name as a function, which is a bad practice.

Advertisement