Skip to content

Commit

Permalink
Basic txt file upload
Browse files Browse the repository at this point in the history
  • Loading branch information
lukin0110 committed Dec 23, 2024
1 parent 0e4be61 commit 5ad76d6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
19 changes: 19 additions & 0 deletions zaps/upload.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from zapman import env

BOUNDERY = "----ZapmanBoundary1234"

POST = f"{env['endpoint']}/files/"

HEADERS = {
"X-API-Key": "dummy",
"Content-Type": f"multipart/form-data; boundary={BOUNDERY}",
}

BODY_RAW = f"""
--{BOUNDERY}\r
Content-Disposition: form-data; name="file"; filename="zappy.txt"\r
Content-Type: text/plain\r\n\r
Hello, World!\r
Hello, Dude!\r
--{BOUNDERY}--\r
"""
7 changes: 7 additions & 0 deletions zaps/zapenvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,10 @@ def env_pie() -> dict[str, str]:
return {
"endpoint": "https://pie.dev",
}


def env_docker() -> dict[str, str]:
return {
# For Docker Desktop (altenatively use the host ip)
"endpoint": "http://host.docker.internal:8001",
}

0 comments on commit 5ad76d6

Please sign in to comment.