code: def _initURL(self,
                   org_url,
                   referer_url):
          
  
  
          if org_url is not None and org_url != '':
              if not org_url.startswith('http://') and not org_url.startswith('https://'):
                  org_url = 'https://' + org_url
              self._org_url = org_url
  
          if self._org_url.lower().find('/sharing/rest') > -1:
              self._url = self._org_url
          else:
              self._url = self._org_url + "/sharing/rest"
  
          if self._url.startswith('http://'):
              self._surl = self._url.replace('http://', 'https://')
          else:
              self._surl = self._url
  
          parsed_url = urlparse(self._org_url)
          self._parsed_org_url = urlunparse((parsed_url[0],parsed_url[1],"","","",""))#added 7/15/2015
  
          if referer_url is None:
              self._referer_url = parsed_url.netloc
docs: sets proper URLs for AGOL