Exemplo n.º 1
0
    def query(self, query, endpoint=None, output='json'):
        request_output = output
        if output == 'ResultSet':
            request_output = 'xml'

        if endpoint is None:
            endpoint = self.default_endpoint
       
        url = self.get_url(query, endpoint, request_output)

        data = open_url(url)
        if output == 'ResultSet':
            return ResultSet(data)
        return data
Exemplo n.º 2
0
    def query(self, query, endpoint=None, output="json"):
        request_output = output
        if output == "ResultSet":
            request_output = "xml"

        if endpoint is None:
            endpoint = self.default_endpoint

        url = self.get_url(query, endpoint, request_output)

        data = open_url(url)
        if output == "ResultSet":
            return ResultSet(data)
        return data
Exemplo n.º 3
0
    def query(self, query, endpoint=None, output='json', include_namespaces = True):
        if include_namespaces:
            query = "%s\n%s" % (self.namespaces_header, query)


        request_output = output
        if output == 'ResultSet':
            request_output = 'xml'

        if endpoint is None:
            endpoint = self.default_endpoint
       
        url = self.get_url(query, endpoint, request_output)

        data = open_url(url)
        if output == 'ResultSet':
            return ResultSet(data)
        return data