Added a new cache argument to post(). The code will look in the cache using the path (without @) as the key before trying to read from the filesystem. Example usage:
with open(path, "rb") as fp
buf = fp.read()
hdr = {"Authorization": f"Bearer {tok}"}
form = {
"options": '{"use_foo": true}',
"input": f"@{path}",
}
cache = {path: buf}
c = OneShotKaClient(url)
res = c.post(headers=hdr, form=form, cache=cache)
Added a new
cache
argument topost()
. The code will look in the cache using the path (without @) as the key before trying to read from the filesystem. Example usage: