Braintree\Http::post PHP Method

post() public method

public post ( $path, $params = null )
    public function post($path, $params = null)
    {
        $response = $this->_doRequest('POST', $path, $this->_buildXml($params));
        $responseCode = $response['status'];
        if ($responseCode === 200 || $responseCode === 201 || $responseCode === 422 || $responseCode == 400) {
            return Xml::buildArrayFromXml($response['body']);
        } else {
            Util::throwStatusCodeException($responseCode);
        }
    }

Usage Example

 public static function createGrant($gateway, $params)
 {
     $http = new Braintree\Http($gateway->config);
     $http->useClientCredentials();
     $response = $http->post('/oauth_testing/grants', array('grant' => $params));
     return $response['grant']['code'];
 }
All Usage Examples Of Braintree\Http::post