You are here

public function ServicesClientConnection::create in Services Client 7

Same name and namespace in other branches
  1. 7.2 services_client_connection/include/connection.inc \ServicesClientConnection::create()

Create data on remote endpoint.

Parameters

string $resource: Resource type like 'node' or 'user'

mixed $data: Optionally additional data that should be added to query

array $query: Additional data passed as URL param

Return value

Response from remote API

File

services_client_connection/include/connection.inc, line 213
Main services client connection class which exposes simple API

Class

ServicesClientConnection
@file Main services client connection class which exposes simple API

Code

public function create($resource, $data = array(), $query = array()) {
  $this->http_request = $this
    ->createRequest(array(
    'resource' => $resource,
    'data' => $data,
    'query' => $query,
    'action' => 'create',
  ));
  return $this
    ->processRequest()->data;
}