lib/Fabulator/Fitbit/FitbitApiBase.php
public function send($url, $method = 'GET', $data = [])
    {
        $method = strtolower($method);

        $settings = [
            'headers'  => array_merge([
                'Authorization' => 'Bearer ' . $this->getToken(),
                'Content-Type' => 'application/x-www-form-urlencoded',
            ], $this->getHeaders()),
        ];

        if ($method == 'post') {
            $settings['form_params'] = $data;
        }

        return $this->client
            ->$method($url, $settings);
    }
public function send($url, $method = 'GET', $data = [])
    {
        $method = strtolower($method);

        $settings = [
            'headers'  => array_merge([
                'Authorization' => 'Bearer ' . $this->getToken(),
                'Content-Type' => 'application/x-www-form-urlencoded',
            ], $this->getHeaders()),
        ];

        if ($method == 'post') {
            $settings['form_params'] = $data;
        }

        return $this->client
            ->$method($url, $settings);
    }
public function send ( $ url , $ method = 'GET' , $ data = [ ] ) { $ method = strtolower ( $ method ) ; $ settings = [ 'headers' => array_merge ( [ 'Authorization' => 'Bearer ' . $ this -> getToken ( ) , 'Content-Type' => 'application/x-www-form-urlencoded' , ] , $ this -> getHeaders ( ) ) , ] ; if ( $ method == 'post' ) { $ settings [ 'form_params' ] = $ data ; } return $ this -> client -> $ method ( $ url , $ settings ) ; }
Send authorized request to Fitbit API.

@param string $url called url
@param string $method http method
@param array $data data in body
@return ResponseInterface response from Fitbit API
Send authorized request to Fitbit API .