IBM / redstone

A Pythonic IBM Cloud SDK
Apache License 2.0
4 stars 9 forks source link

Custom-Header-Support #20

Open harshit777 opened 1 year ago

harshit777 commented 1 year ago

Reference to the Issue

harshit777 commented 1 year ago

Code and Evidence

1) Client Config Call

    kp = redstone.service("KeyProtect",
        credentials=tm,
        region=region_name,
        service_instance_id=service_id,
        endpoint_url= "",
        headers = {
            "Custom-Header" : "Custom-value-Client",
        }
    )
Screen Shot 2022-12-20 at 12 33 02 PM

2) Per API Call

kp.session.headers["Custom-Header"] = "Cuatom-Value-API"
key = kp.create_key(name="MyTestKey")
kp.session.headers["Custom-Header"] = None
print(kp.get(key.get('id')))
Screen Shot 2022-12-20 at 12 32 27 PM