Post Method

@param  array $data Data to be encoded
@return Stanley\Geocodio\Data
437549
public function post($data, $fields = [], $key = null, $verb = 'geocode')
    {
        if ($key) $this->apiKey = $key;
        $request = $this->bulkPost($data, $fields, $verb);
        return $this->newDataObject($request->getBody());
    }
31554
public function postRequest($uri, array $data = null)
    {
        return $this->getClient()->post($uri, [
            'json' => $this->createBody($data)
        ]);
    }
1220679
public function store(array $data)
    {
        $projectConstruction = $this->client->post(
            sprintf('templates/%d/project_constructions.json', $this->parent),
            [
                'json' => $data,
            ]
        );

        return $this->response($projectConstruction);
    }
357004
public function send($data = [])
    {
        if (is_array($data)) {
            $data = json_encode($data);
        }

        $this->getBody()->write($data);

        return $this;
    }
1210529
public function fromArray(array $data = [])
    {
        if (isset($data['providerName'])) {
            $this->providerName = $data['providerName'];
        }
        if (isset($data['query'])) {
            $this->query = $data['query'];
        }
        if (isset($data['exception'])) {
            $this->exception = $data['exception'];
        }

        //GeoCoder Address::createFromArray expects longitude/latitude keys
        $data['address']['longitude'] = $data['address']['coordinates']['longitude'] ?? null;
        $data['address']['latitude'] = $data['address']['coordinates']['latitude'] ?? null;

        // Shortcut to create the address and set it in this class
        $this->setAddress(Address::createFromArray($data['address']));
    }
973556
public function store($data)
    {
        $response = Request::post($this->uri)
            ->authenticateWith($this->username, $this->password)
            ->body(json_encode($data))
            ->sendsType('application/json')
            ->send();

        return $this->processResponse($response);
    }
1288235
public static function encode($data)
    {
        if (is_object($data)) {
            if (method_exists($data, "toArray")) {
                $data = $data->toArray();
            } else {
                $data = (array) $data;
            }
        }

        $encoder = new self($data);
        $encoded = $encoder->doEncode();

        return $encoded;
    }
1113984
public function sendData($data)
    {
        $data = parent::sendData($data);

        return $this->response = new AopTradePreCreateResponse($this, $data);
    }
1310274
public function createEvent(array $data)
    {
        $json = json_encode($data);

        return $this->sendRequest('POST', $this->eventUrl, $json);
    }
262340
public function store(array $data)
    {
        $upload = $this->client->post(
            sprintf('buckets/%d/vaults/%d/uploads.json', $this->bucket, $this->parent),
            [
                'json' => $data,
            ]
        );

        return new Upload($this->response($upload));
    }
469763
public function create(array $data)
    {
        $url = $this->getUrl('create');
        $request = urldecode(json_encode($data, JSON_UNESCAPED_UNICODE));
        $json = $this->curl->post($url, $request);

        return $json;
    }
1221444
public function sendData($data)
    {
        $url = $this->getEndpoint();

        $body = [
            'form_params' => $data,
        ];

        if ($this->getTestMode()) {
            $body = [
                'verify' => false,
            ];
        }

        $response = $this->httpClient->post($url, [], $body);

        $contents = (string) $response->getBody();
        $xml = simplexml_load_string($contents);

        return $this->createResponse($xml);
    }
122431
public function sendData($data)
    {
        $data = $this->httpRequest('back', $data);

        $env        = $this->getEnvironment();
        $rootCert   = $this->getRootCert();
        $middleCert = $this->getMiddleCert();

        $data['verify_success'] = ResponseVerifyHelper::verify($data, $env, $rootCert, $middleCert);

        return $this->response = new WtzBackOpenResponse($this, $data);
    }
516904
protected function _post($data) {
		$ch = curl_init();
		curl_setopt_array($ch, array(
			CURLOPT_URL            => static::ENDPOINT,
			CURLOPT_POST           => true,
			CURLOPT_POSTFIELDS     => json_encode($data),
			CURLOPT_HEADER         => false,
			CURLOPT_RETURNTRANSFER => true,
			CURLOPT_SSL_VERIFYPEER => true,
			CURLOPT_SSL_VERIFYHOST => 2,
			CURLOPT_FOLLOWLOCATION => false,
			CURLOPT_HTTPHEADER => array('Content-Type: application/json')
		));

		$response = curl_exec($ch);
		curl_close($ch);

		if ($response === false) {
			throw new Exception('Failed to contact BrowserID verification service');
		}

		$decodedResponse = json_decode($response);
		if (!$decodedResponse) {
			throw new Exception('Response is not valid JSON');
		}

		return $decodedResponse;
	}
313918
public function update($data = array()) {
    foreach ($data as $key => $value) {
      $this->{$key} = $value;
    }

    $postData = array();
    foreach (static::$properties as $name) {
      $postData[$name] = $this->data[$name];
    }

    $this->client->put(static::$path . '/' . $this->id(), $postData);

    return $this;
  }
1009679
public static function buildEnEmojiData(array $data)
    {
        foreach ($data as $key => $value) {
            if (is_array($value)) {
                $data[$key] = self::buildEnEmojiData($value);
            } elseif (is_string($value)) {
                $data[$key] = self::emojiEncode($value);
            } else {
                $data[$key] = $value;
            }
        }
        return $data;
    }
230911
public function sendData($data)
    {
        $response = $this->braintree->merchantAccount()->create($data);

        return $this->response = new Response($this, $response);
    }