Json gives 301 moved forever

in Firefox, only on firefox it will pop up and give you a warning "This web page is being redirected to a new location. Would you like to send this form that you typed to a new location."

I don't have a form, I use javascript to extract values ​​from a text field

I checked on firebug which says PUT / admin / submit-scan / 301 constantly moves PUT submit-scan 302 Found

My js

function submitGoods(){
    var registeredNo = $('input[name=registeredno]').val();
    var weight = $('input[name=weight]').val();
        $.ajax({
            type: 'PUT',
            url: '/admin/submit-scan/',
            data: {
                registeredNo: registeredNo,
                weight: weight,
                _token: csrfToken
            },
            dataType: 'json'
        }).done(function(data){

                data = $.parseJSON(data);
            });

}

My route

Route::put('submit-scan', 'Controllers\Admin\DashboardController@putUpdateSubmitScan');

My controller

 public function putUpdateSubmitScan()
    {
        if (Request::ajax())
        {
            return Response::json(array('success' => 1, 'data' => "test"));
        }
    }

Any idea what went wrong?

+4
source share
2 answers

Removing the trailing slash should do the trick (most likely before Laravel 4.1, see below).

url: '/admin/submit-scan'

Update

Laravel4 POST GET

Laravel bootstrap/start.php $app->redirectIfTrailingSlash();, , -, . Laravel 4.1:

http://laravel.com/docs/upgrade#upgrade-4.1

+30

301, URL-,

url: '/admin/submit-scan/{Somethinghere}'

, pure/admin/submit-scan/, put , url, ,

-1