In PHP, HTTP integrates as the so-called & shy; Docs . This means that you can use it with standard file and stream functions:
$url = 'http://api.test.com/import-lead-data.php';
$result = file_get_contents($url);
This will create a standard GET request. But you want to get a POST request, so you need to add some options context & shy; Docs :
$url = 'http://api.test.com/import-lead-data.php';
$options['http'] = array(
'method' => "POST",
);
$context = stream_context_create($options);
$result = file_get_contents($url, NULL, $context);
POST GET. - . , = > :
$url = 'http://api.test.com/import-lead-data.php';
$content = http_build_query($form_fields);
$options['http'] = array(
'method' => "POST",
'content' => $content,
);
$context = stream_context_create($options);
$result = file_get_contents($url, NULL, $context);
, . , http_post_data http_post_fields, .
: HEAD PHP.