"T", "trcode" => $trcode, "termtype" => "HTS"); $input = array( "szSymbol" => $symbol); $indata = array( "Header" => $header, "Input1" => $input); $sdata = json_encode($indata); } $ch = curl_init(); //curl 초기화 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //요청 결과를 문자열로 반환 curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); //connection timeout 10초 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //원격 서버의 인증서가 유효한지 검사 안함 //curl_setopt($ch, CURLOPT_SSLVERSION, 3); // SSL 버젼 (https 접속시에 필요) curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); if($method === "POST") { curl_setopt($ch, CURLOPT_POSTFIELDS, $sdata); curl_setopt($ch, CURLOPT_URL, $url); //URL 지정하기 } else curl_setopt($ch, CURLOPT_URL, $sdata); //URL 지정하기 $response = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); $error = curl_error($ch); curl_close($ch); return $response; } function GetTrCode() { $method = $_SERVER['REQUEST_METHOD']; if($method === 'POST'){ $trcode = $_POST["trcode"]; } else if($method === 'GET') { $trcode = $_GET["trcode"]; } if($trcode === NULL) $trcode = 't9732'; return $trcode; } function GetSymbol() { $method = $_SERVER['REQUEST_METHOD']; if($method === 'POST'){ $symbol = $_POST["szSymbol"]; } else if($method === 'GET') { $symbol = $_GET["szSymbol"]; } if($symbol === NULL) $symbol = 'BTCUSDT'; return $symbol; } function GetMethod() { $method = $_SERVER['REQUEST_METHOD']; return $method; } ?> WsPlus Test

>GET >POST
TR-CODE: >
Symbol : >