Skip to content

Instantly share code, notes, and snippets.

@stephendarling
Last active April 15, 2019 11:34
Show Gist options
  • Select an option

  • Save stephendarling/7185917dd076d319b0c36039b28b4a52 to your computer and use it in GitHub Desktop.

Select an option

Save stephendarling/7185917dd076d319b0c36039b28b4a52 to your computer and use it in GitHub Desktop.
import requests
...
# Send REST request with Bearer OAuth2 token
# run_service_url = The https endpoint created automatically by your new Cloud Run service
# token = The response from the step above
request = requests.get(
url = run_service_url,
headers = {
'Authorization': f'Bearer {token}'
}
)
results = {
'status_code': request.status_code,
'response': request.json()
}
print(json.dumps(results, indent=2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment