Answer the question
In order to leave comments, you need to log in
Why is Laravel not outputting data from post?
Why is Laravel not outputting data from post? When I just return $formData it outputs like: {{"title":"you","text":"you"}: ""} But when I try to output something like $formData['title'] then he writes, they say:
ErrorException in UserController.php line 13:
Undefined index: title
<?php namespace App\Http\Controllers;
use Illuminate\Http\Response;
use App\Http\Controllers\Controller;
use Request;
class UserController extends Controller
{
public function index() {
$formData = Request::all();
return $formData;
}
}
?>
$scope.sendform = function(e) {
e.preventDefault();
$scope.formData = {};
var title = this.title;
var text = this.text;
var req = {
method: 'POST',
url: '/send',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
data: { title: title, text: text }
}
$http(req).then(function(){
alert("success!")
}, function(){
alert("error!")
});
}
Answer the question
In order to leave comments, you need to log in
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
data: { title: title, text: text }
function transformRequest(data) {
return $.param(data);
}
var req = {
method: 'POST',
url: '/send',
data: {title: this.title, text: this.text},
transformRequest: transformRequest,
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
}
Firstly, I can advise the online broadcast service - www.ustream.tv in addition to the one above.
Secondly, if you have thoughts about making money on online broadcasting, you should look at creating your own broadcasting mechanism, it's not that difficult. I wrote a note not so long ago about the choice between free services and my own solutions, perhaps this will give food for thought.
Here are instructions for setting up Wirecast software, OpenBroadcaster and a number of other programs to work with the Facecast service .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question