2016-05-18 7 views

答えて

3

はい、あなただけの必要CURLOPT_PORTを指定するなど、あなたのURLにポートを省略:

<?php 
$post = [ 
    'field' => 'value', 
]; 
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, 'http://192.168.1.30/server'); 
curl_setopt($ch,CURLOPT_PORT, 8080); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); 
$response = curl_exec($ch); 
if ($response === false) { 
    throw new RuntimeException(curl_error($ch)); 
} 
var_export($response); 
関連する問題