def _readFromUrl(self, url, data, timeout, method='<STR_LIT>', username=None, password=None,<EOL>headers=None, verify=True, cert=None):
if method == '<STR_LIT>':<EOL><INDENT>request_url = build_get_url(url, data, overwrite=True)<EOL>log.debug(request_url)<EOL>spliturl = request_url.split('<STR_LIT:?>')<EOL>u = openURL(spliturl[<NUM_LIT:0>], spliturl[<EOL><NUM_LIT:1>], method='<STR_LIT>', username=username, password=password,<EOL>headers=headers, verify=verify, cert=cert, timeout=self.timeout)<EOL>return etree.fromstring(u.read())<EOL><DEDENT>elif method == '<STR_LIT>':<EOL><INDENT>u = openURL(url, data, method='<STR_LIT>',<EOL>username=username, password=password,<EOL>headers=headers, verify=verify, cert=cert, timeout=timeout)<EOL>return etree.fromstring(u.read())<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>" % method)<EOL><DEDENT>
Method to get and parse a WPS document, returning an elementtree instance.
:param str url: WPS service base url.
:param str data: GET: dictionary of HTTP (key, value) parameter pairs, POST: XML document to post
:param str username: optional user credentials
:param str password: optional user credentials