Let's assume this is being executed in jQuery:
$.ajax({
url : 'ajaxcall.php',
data : { 'data' : { ary : [1,2,3,3,4,5], txt : "ima let u finish" } },
dataType : 'json',
type : 'post',
timeout : 10000
});
And ajaxcall.php contains:
$return_obj = array();
$return_obj['ary'] = array(9,8,7,6,5);
$return_obj['txt'] = "ok then";
echo json_encode($return_obj);
die();
I'm expecting the following situations to occur (due to packet loss, connection problems, etc):
- Ajaxcall.php executes, but the $_POST variable is empty.
- The promises of the $.ajax() call are executed, but the data returned to them is empty.
However, what I'm really worried about are situations like these:
- Ajaxcall.php executes and $_POST['data']['txt'] has expected values but $_POST['data']['ary'] is missing some values.
- The promises of the $.ajax() call are executed and data.ary has the expected values, but data.txt is only half a string (e.g., "ok t").
Are these situations possible?