How to detect end of page event

I want to trigger an event when scroller reaches the end of the page.

Once it reaches the end of the page, I have to make some HTTP call and show the response.
How can I do this?