MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / python_curl_task

Function python_curl_task

tools/tasks.py:449–463  ·  view source on GitHub ↗

Return the output from the request after post processing.

()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

urlopenFunction · 0.85
readMethod · 0.80

Tested by

no test coverage detected