TMCO
786
11
General

Ajax POST – 500 Internal Server Error

Posted 4 years ago by TMCO

I'm trying to learn how to use AJAX in my Laravel application and I'm struggling with the POST method.

For testing, I've got a basic controller that simply returns true, but when I inspect my network tab, the AJAX POST to my controller is returning a 500 Internal Server Error.

$http.post('http://example.com/ajax/test', data).success(function(response) {
    alert(response);
}

public function test() {
    return true;
}

Any idea what could be going wrong?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.