remote::post PHP Method

post() public method

public post ( $url, $data = [], $format = false, $options = [] )
    function post($url, $data = array(), $format = false, $options = array())
    {
        $data = http_build_query($data);
        $response = self::request($url, $data, $options);
        $content = a::get($response, 'content');
        if (core::error($response)) {
            return $response;
        }
        if (empty($content)) {
            return false;
        }
        if ($format) {
            return self::parse($content, $format);
        }
        return $content;
    }

Usage Example

Example #1
0
 /**
  * Invoke a Slack API method.
  */
 private static function api($method, $params)
 {
     return json_decode(remote::post('https://slack.com/api/' . $method, ['data' => array_merge($params, ['token' => c::get('slack.auth')])]), true);
 }
All Usage Examples Of remote::post