public function requestServerData($uri, $postData = [])
    {
        $result = Http::post($this->createServerUrl($uri), function ($http) use ($postData) {
            $this->applyHttpAttributes($http, $postData);
        });

        if ($result->code == 404) {
            throw new ApplicationException(Lang::get('system::lang.server.response_not_found'));
        }

        if ($result->code != 200) {
            throw new ApplicationException(
                strlen($result->body)
                ? $result->body
                : Lang::get('system::lang.server.response_empty')
            );
        }

        $resultData = false;

        try {
            $resultData = @json_decode($result->body, true);
        }
        catch (Exception $ex) {
            throw new ApplicationException(Lang::get('system::lang.server.response_invalid'));
        }

        if ($resultData === false || (is_string($resultData) && !strlen($resultData))) {
            throw new ApplicationException(Lang::get('system::lang.server.response_invalid'));
        }

        return $resultData;
    }
public function requestServerData($uri, $postData = [])
    {
        $result = Http::post($this->createServerUrl($uri), function ($http) use ($postData) {
            $this->applyHttpAttributes($http, $postData);
        });

        if ($result->code == 404) {
            throw new ApplicationException(Lang::get('system::lang.server.response_not_found'));
        }

        if ($result->code != 200) {
            throw new ApplicationException(
                strlen($result->body)
                ? $result->body
                : Lang::get('system::lang.server.response_empty')
            );
        }

        $resultData = false;

        try {
            $resultData = @json_decode($result->body, true);
        }
        catch (Exception $ex) {
            throw new ApplicationException(Lang::get('system::lang.server.response_invalid'));
        }

        if ($resultData === false || (is_string($resultData) && !strlen($resultData))) {
            throw new ApplicationException(Lang::get('system::lang.server.response_invalid'));
        }

        return $resultData;
    }
public function requestServerData ( $ uri , $ postData = [ ] ) { $ result = Http :: post ( $ this -> createServerUrl ( $ uri ) , function ( $ http ) use ( $ postData ) { $ this -> applyHttpAttributes ( $ http , $ postData ) ; } ) ; if ( $ result -> code == 404 ) { throw new ApplicationException ( Lang :: get ( 'system::lang.server.response_not_found' ) ) ; } if ( $ result -> code != 200 ) { throw new ApplicationException ( strlen ( $ result -> body ) ? $ result -> body : Lang :: get ( 'system::lang.server.response_empty' ) ) ; } $ resultData = false ; try { $ resultData = @ json_decode ( $ result -> body , true ) ; } catch ( Exception $ ex ) { throw new ApplicationException ( Lang :: get ( 'system::lang.server.response_invalid' ) ) ; } if ( $ resultData === false || ( is_string ( $ resultData ) && ! strlen ( $ resultData ) ) ) { throw new ApplicationException ( Lang :: get ( 'system::lang.server.response_invalid' ) ) ; } return $ resultData ; }
Contacts the update server for a response.
@param  string $uri      Gateway API URI
@param  array  $postData Extra post data
@return array
Contacts the update server for a response .