Return the output from the request after post processing.
()
| 447 | """ |
| 448 | |
| 449 | def python_curl_task() -> Union[bytes, str]: |
| 450 | """ |
| 451 | Return the output from the request after post processing. |
| 452 | """ |
| 453 | try: |
| 454 | response_file_handle = urlopen(url, auth_headers) |
| 455 | except urllib.error.URLError as e: |
| 456 | print("WARNING: Error connecting to url {0}: {1}".format(url, e)) |
| 457 | return b"" |
| 458 | |
| 459 | response_string: bytes = response_file_handle.read() |
| 460 | if content_postprocessors: |
| 461 | for content_postprocessor in content_postprocessors: |
| 462 | response_string = content_postprocessor(response_string) |
| 463 | return response_string |
| 464 | |
| 465 | return PythonTask( |
| 466 | description=name, callable=python_curl_task, log_file=log_file, **kwargs |