Skip to content

Commit 85123dc

Browse files
authored
Pass input-data b64 encoded (#28)
func: pass input-data b64 encoded
1 parent e41f6fa commit 85123dc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tasks/func.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
)
77

88
import requests
9+
from base64 import b64encode
910
from os.path import join
1011
from invoke import task
1112
from os import makedirs, listdir
@@ -69,7 +70,9 @@ def invoke(ctx, user, func, input_data=None):
6970
}
7071

7172
if input_data:
72-
data["input_data"] = input_data
73+
data["input_data"] = b64encode(input_data.encode("utf-8")).decode(
74+
"utf-8"
75+
)
7376

7477
headers = get_knative_headers()
7578
response = requests.post(url, json=data, headers=headers)

0 commit comments

Comments
 (0)