Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)

        def push_json(url, data, session_id, no_raise_for=tuple()):
    headers = {'Content-Type': 'application/json'}
    if session_id:
        headers['session-id'] = session_id
    response = requests.post(url, json.dumps(data), headers=headers)
    if response.status_code not in no_raise_for:
        response.raise_for_status()
    return response
        


src/s/b/sbgsdk-0.5.4/sbdk/commands/push.py   sbgsdk(Download)
from sys import exit
 
from sbdk.auth import push_url, push_json
from sbdk.commands import check_project_dir, check_image, check_project_data
from sbdk.docker import make_runner
        url = push_url(project, container.user)
        try:
            push_json(url, push_data, container.token)
        except requests.HTTPError as e:
            if e.response.status_code in (401, 402):
                container.load_credentials(renew=True)
                push_json(url, push_data, container.token)