public function searchResources(RepositorySearchCriteria $criteria = null)
    {
        $url = self::makeUrl($criteria);
        $response = $this->service->makeRequest($url, array(200, 204), 'GET', null, true, 'application/json', 'application/json');

        if ($response['statusCode'] == 204 || $response['body'] == null) {
            // A SearchResourceResult with 0 counts, and no items
            return new SearchResourcesResult(null, 0, 0, 0);
        }

        $data = $response['body'];
        $headers = RESTRequest::splitHeaderArray($response['headers']);

        // If forceTotalCount is not enabled, the server doesn't return totalCount when offset is specified
        if(!isset($headers['Total-Count']))
            $totalCount = null;
        else
            $totalCount = (int) $headers['Total-Count'];

        return new SearchResourcesResult(json_decode($data), (int) $headers['Result-Count'], (int) $headers['Start-Index'], $totalCount);
    }