import requests


def grid(url, resource='/grid'):
    """Return grid definitions.
  
    Args:
        url (str): protocol://host:port/path
        resource (str): /the/grid/resource (default: /grid)
 
    Returns:
        dict

    Example:
        >>> chipmunk.grid(url='http://host:port/path)
        [{"name":"tile",
          "proj":null,
          "rx":1.0,
          "ry":-1.0,
          "sx":150000.0,
          "sy":150000.0,
          "tx":2565585.0,
          "ty":3314805.0},
         {"name":"chip",
          "proj":null,
          "rx":1.0,
          "ry":-1.0,
          "sx":3000.0,
          "sy":3000.0,
          "tx":2565585.0,
          "ty":3314805.0}]
    """
    
    url = '{}{}'.format(url, resource)
    return requests.get(url=url).json()