static public function basicRequest($method, $url, $basicAuth, $postData = null)
    {
        $options = [
            'headers' => [
                'User-Agent' => self::USER_AGENT_PREFIX . \Pmp\Sdk::VERSION,
                'Accept' => 'application/json',
                'Authorization' => $basicAuth,
            ]
        ];
        if (strtolower($method) == 'post' && !empty($postData)) {
            $options['headers']['Content-Type'] = 'application/x-www-form-urlencoded';
            $formParams = [];
            foreach ($postData as $key => $value) {
                if ($value) {
                    $formParams[$key] = $value;
                }
            }
            $options['form_params'] = $formParams;
        }

        return self::_sendRequest($method, $url, $options);
    }
static public function basicRequest($method, $url, $basicAuth, $postData = null)
    {
        $options = [
            'headers' => [
                'User-Agent' => self::USER_AGENT_PREFIX . \Pmp\Sdk::VERSION,
                'Accept' => 'application/json',
                'Authorization' => $basicAuth,
            ]
        ];
        if (strtolower($method) == 'post' && !empty($postData)) {
            $options['headers']['Content-Type'] = 'application/x-www-form-urlencoded';
            $formParams = [];
            foreach ($postData as $key => $value) {
                if ($value) {
                    $formParams[$key] = $value;
                }
            }
            $options['form_params'] = $formParams;
        }

        return self::_sendRequest($method, $url, $options);
    }
static public function basicRequest ( $ method , $ url , $ basicAuth , $ postData = null ) { $ options = [ 'headers' => [ 'User-Agent' => self :: USER_AGENT_PREFIX . \ Pmp \ Sdk :: VERSION , 'Accept' => 'application/json' , 'Authorization' => $ basicAuth , ] ] ; if ( strtolower ( $ method ) == 'post' && ! empty ( $ postData ) ) { $ options [ 'headers' ] [ 'Content-Type' ] = 'application/x-www-form-urlencoded' ; $ formParams = [ ] ; foreach ( $ postData as $ key => $ value ) { if ( $ value ) { $ formParams [ $ key ] = $ value ; } } $ options [ 'form_params' ] = $ formParams ; } return self :: _sendRequest ( $ method , $ url , $ options ) ; }
Make a request using basic authentication

@param string $method the HTTP method
@param string $url the absolute location
@param string $basicAuth the basic auth string
@param array $postData POST data
@return array the response status and body as array(int $status, \StdClass $body, array $rawData)
Make a request using basic authentication