You are here

public function PhpCurlHttpClient::post in Backup and Migrate 5.0.x

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 src/Core/Service/PhpCurlHttpClient.php
Post a file along with other data (as an array).

File

src/Core/Service/PhpCurlHttpClient.php, line 34

Class

PhpCurlHttpClient
@package Drupal\backup_migrate\Core\Service

Namespace

Drupal\backup_migrate\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);
}