Source Code : test_Stemmer_singleWord.html


<script type="text/javascript"> 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Όνομα Ζώο Φυτό - Το παιχνίδι  </title>
    <script src="tests_pretty.js"></script>
</head>
<body>
Example :
<mark>Services Word Games</mark>
<br/> <br/>
<br/> <br/>
<script>
    displayInfo(" api :  "+ URL , null, 'url');
    let sPlugin = "GRStemmer";
    const data = {
	        "configuration": [sPlugin, "", ""],
	        'word': ' Απόδειξη ',
	  //      'word': ' σκατά ',
	};
    fetch(URL, {
	        method: "POST",
	        body: JSON.stringify(data),
	        headers: {
		            "Content-type": "application/json;
		 charset=UTF-8"
		}
	}).then(response => response.json())
        .then(dataRet => {
	            displayInfo("  Service Call   ", data, 'retCall');
	            const returnJSON = JSON.parse(dataRet);
	            displayInfo(sPlugin + "  Returns Json  ", returnJSON, 'retInfo');
	})
        .catch((error) => {
	            displayInfo(" Error : " + error, data);
	});
</script>
</body>
</html>
</script>



Typical Syntax Call


<script type="text/javascript"> 

    let URL = 'https://xxx.xxx.xxx.xxx/service.php'
    let sPlugin = "plugin";
    //
    const data = {  "configuration": [sPlugin, "action", "extra"],
	                    'word': ' Απόδειξη ',
	};
    //
    fetch(URL, {    method: "POST",   body: JSON.stringify(data),
	headers: {   "Content-type": "application/json;
		 charset=UTF-8"    
		}
	}).then(response => response.json())
        .then(dataRet => {
	            const returnJSON = JSON.parse(dataRet);
	             // returnJSON  
	             // ....
	             ///
	})
        .catch((error) => {
	            displayInfo(" Error : " + error, data);
	});

</script>