jquery $.post – sending a string of 7KB – results in 403 error

need to send html of a page to server – to check something but – … Read more jquery $.post – sending a string of 7KB – results in 403 error

need to send html of a page to server – to check something
but – getting error in console

$(window).on('load', function(){
    var str = document.documentElement.innerHTML;  // doesn't work
    //changing to var str = 'lorem'; - this works 
    console.log(typeof(str)); // string
    console.log(str); // works in both cases
    $.post('check.php', {ht: str}, function(data){  // error line
        console.log(data);
    });
});

check.php

$str = $_POST['ht'];
echo $str;

console

POST https://example.com/check.php 403
the entire html as text is about 7 KB
so what is wrong with sending html (as string)

Source: JavaSript – Stack Overflow


Categories: NewsTags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *