docs: def request(identifier, namespace='cid', domain='compound', operation=None, output='JSON', searchtype=None, **kwargs):
      """
      Construct API request from parameters and return the response.
  
      Full specification at http://pubchem.ncbi.nlm.nih.gov/pug_rest/PUG_REST.html
      """
      if not identifier:
          raise ValueError('identifier/cid cannot be None')
      # If identifier is a list, join with commas into string
      if isinstance(identifier, int):
          identifier = str(identifier)
      if not isinstance(identifier, text_types):
          identifier = ','.join(str(x) for x in identifier)
      # Filter None values from kwargs
      kwargs = dict((k, v) for k, v in kwargs.items() if v is not None)
      # Build API URL
      urlid, postdata = None, None
      if namespace == 'sourceid':
          identifier = identifier.replace('/', '.')
      if namespace in ['listkey', 'formula', 'sourceid'] \
              or searchtype == 'xref' \
              or (searchtype and namespace == 'cid') or domain == 'sources':
          urlid = quote(identifier.encode('utf8'))
      else:
          postdata = urlencode([(namespace, identifier)]).encode('utf8')
      comps = filter(None, [API_BASE, domain, searchtype, namespace, urlid, operation, output])
      apiurl = '/'.join(comps)
      if kwargs:
          apiurl += '?%s' % urlencode(kwargs)
      # Make request
      try:
          log.debug('Request URL: %s', apiurl)
          log.debug('Request data: %s', postdata)
          response = urlopen(apiurl, postdata)
          return response
      except HTTPError as e:
          raise PubChemHTTPError(e)