Recived JSON data sen by Jquery

Recived JSON data sen by Jquery

Hi.
I have a problem with recived JSON data by Jquey. I recive data ba Google apps script, but this no matter.
Data is sensed (by test) from html file from my local computer and recived by Google script.
Code of my html.
  1. <!DOCTYPE html>
  2. <html lang='pl'>
  3.   <head>
  4.     <meta charset='utf-8'>
  5.   </head>
  6.   <body>
  7.   <div onclick ="A1()"> TEST </div>
  8.   </body>
  9.    <script
  10.   src="http://code.jquery.com/jquery-3.3.1.js"
  11.   integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60="
  12.   crossorigin="anonymous"></script> 
  13.   <script type="application/javascript">
  14.  $.ajaxSetup({
  15. url: "https://script.google.com/macros/s/***//exec",
  16. type: "post"
  17. });
  18. function A1() {
  19. var sub_d = [ "a1", 2, "a3" ];
  20. var d1 = { test1 : "pass1" };
  21. var d2 =  { test1: sub_d };
  22. var d3 = JSON.stringify(d1);
  23. var d4 = JSON.stringify(d2);
  24. var res = $.ajax (
  25. {
  26. data: d4,
  27. beforeSend: function() { alert(d2); }
  28. });
  29. res.done(function (odpserv, textStatus, jqXHR) {
  30. console.log(odpserv);
  31. console.log(textStatus);
  32. console.log(jqXHR);
  33. });
  34. }
  35.  </script>

Google code.gs
  1. function doPost(e){
  2.  var ERrrS, ES; 
  3.  try {
  4.    var SS = SpreadsheetApp.openById('****');
  5.    var sh = SS.getSheetByName('A');
  6.      
  7.    sh.appendRow([ e, e.parameter])
  8.       
  9.    ES= "OK";
  10.       
  11.   }
  12. catch (err) {
  13.   ES = err;
  14.   }



First problem
I don't know whay recived data JSON looks
{parameter={test1=pass1}, contextPath=, contentLength=11, queryString=, parameters={test1=[Ljava.lang.Object;@4afd9e0c}, postData=FileUpload}

Whay I recive " parameter= " or " contextPath= " keys in data. Look code above. Anywher I don't add any additional data. So why I recive what I recive?

Second

If I send  var d1 = { test1 : "pass1" } ; i expect  recive  { test1 : "pass1" }

If I send d1  virable i recive  {test1=pass1} in parameter objec. Why I don't recive {test1 : pass1}
If I send  d3  virable i recive  {{"test1":"pass1"}=}.
Why?

But this is small problem, because I can read data in obj.parameter

Third - Arrays - There I don't understand anything.

Sending d2 I recive   {test1[]=a1} in e.parameter
Sending d4 I get {{"test1":["a1",2,"a3"]}=}
It's look as a Key in e.parameter. array

  1.  e= { parameter :   [
  2.    {"test1":["a1",2,"a3"]} : =
  3.     ]
  4. }
Of course I was tried parse (  JSON.parse() ) all recived data ( e), and  e.parametre, but anyway I couldn't read ( in Google script) the AJAX's send data (Array)

Please let my know, what I doing wrong, where I make mistake.