You are here

public function PhpCurlHttpClient::post in Backup and Migrate 8.4

Post the given data (as a string or an array) to the given URL.

Parameters

$url:

$data:

Return value

mixed

Overrides HttpClientInterface::post

1 call to PhpCurlHttpClient::post()
PhpCurlHttpClient::postFile in lib/backup_migrate_core/src/Service/PhpCurlHttpClient.php
Post a file along with other data (as an array).

File

lib/backup_migrate_core/src/Service/PhpCurlHttpClient.php, line 34

Class

PhpCurlHttpClient
Class PhpCurlHttpClient.

Namespace

BackupMigrate\Core\Service

Code

public function post($url, $data) {
  $ch = $this
    ->getCurlResource($url);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  return $this
    ->curlExec($ch);
}