You are here

public function ServicesEndpointTests::services_build_postfields in Services 6.3

Builds out our post fields

File

tests/functional/ServicesEndpointTests.test, line 325

Class

ServicesEndpointTests
Run test cases for the endpoint with no authentication turned on.

Code

public function services_build_postfields($data = array()) {
  $post_data = '';
  if (is_array($data) && !empty($data)) {
    array_walk($data, array(
      $this,
      'services_flatten_fields',
    ));
    $post_data = implode('&', $data);
  }
  if (is_object($data) && !empty($data)) {
    array_walk(get_object_vars($data), array(
      $this,
      'services_flatten_fields',
    ));
    $post_data = implode('&', $data);
  }
  return $post_data;
}