| 825 | return r |
| 826 | |
| 827 | def curl_raw(self, urls, timeout=10, options=None, insecure=False, |
| 828 | force_resolve=True, no_stdout_list=False): |
| 829 | if not isinstance(urls, list): |
| 830 | urls = [urls] |
| 831 | stdout_list = False |
| 832 | if len(urls) > 1 and not no_stdout_list: |
| 833 | stdout_list = True |
| 834 | args, headerfile = self.curl_complete_args( |
| 835 | urls=urls, stdout_list=stdout_list, |
| 836 | timeout=timeout, options=options, insecure=insecure, |
| 837 | force_resolve=force_resolve) |
| 838 | args += urls |
| 839 | r = self.run(args, stdout_list=stdout_list) |
| 840 | if r.exit_code == 0: |
| 841 | self.curl_parse_headerfile(headerfile, r=r) |
| 842 | if r.json: |
| 843 | r.response["json"] = r.json |
| 844 | if os.path.isfile(headerfile): |
| 845 | os.remove(headerfile) |
| 846 | return r |
| 847 | |
| 848 | def curl_get(self, url, insecure=False, options=None): |
| 849 | return self.curl_raw([url], insecure=insecure, options=options) |