import json
import requests


def get_arc_servicedict(url):
    """Returns a dict of service information for an ArcGIS REST service URL
    
    Arguments
        url (String): An ArcGIS REST service URL, 
            e.g. 'http://services.slip.wa.gov.au/arcgis/rest/services/QC/MRWA_Public_Services/MapServer'
    """
    res = json.loads(requests.get(url + "?f=pjson").content)
    d = dict()
    d["layer_ids"] = [str(x['id']) for x in res["layers"]]
    d["supportedExtensions"] = res["supportedExtensions"]
    return d