From 0ecdce5a843c1209d87460b797e1024932b90747 Mon Sep 17 00:00:00 2001 From: gnieark Date: Sun, 29 May 2016 22:18:36 +0200 Subject: [PATCH] full JSON --- src/arenas/connectFour/functions.php | 1 - src/arenas/tictactoe/functions.php | 14 ++------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/arenas/connectFour/functions.php b/src/arenas/connectFour/functions.php index c7f2d7f..b6208ce 100644 --- a/src/arenas/connectFour/functions.php +++ b/src/arenas/connectFour/functions.php @@ -22,7 +22,6 @@ function get_IA_Response($iaUrl,$postParams){ 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string)) ); - echo '

'.$data_string.'

'; $output= curl_exec($ch); curl_close($ch); diff --git a/src/arenas/tictactoe/functions.php b/src/arenas/tictactoe/functions.php index e204453..2f85f4f 100644 --- a/src/arenas/tictactoe/functions.php +++ b/src/arenas/tictactoe/functions.php @@ -38,17 +38,7 @@ function get_IA_Response($iaUrl,$postParams){ //send params JSON as body $data_string = json_encode($postParams); - /* - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $iaUrl); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $postParams); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - $output = curl_exec($ch); - curl_close($ch); - - */ - + $ch = curl_init($iaUrl); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); @@ -59,6 +49,6 @@ function get_IA_Response($iaUrl,$postParams){ ); $output= curl_exec($ch); curl_close($ch); - + echo '

'.$data_string.'

'; return htmlentities($output); } \ No newline at end of file