/tasks/create/file

POST /tasks/create/file

Bir dosyayı bekleyen görevler listesine ekler. Yeni oluşturulan görevin kimliğini döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" -F file=@/path/to/file http://localhost:8090/tasks/create/file

Python kullanılan örnek request:

import requests

REST_URL = "<http://localhost:8090/tasks/create/file>"
SAMPLE_FILE = "/path/to/malwr.exe"
HEADERS = {"Authorization": "Bearer S4MPL3"}

with open(SAMPLE_FILE, "rb") as sample:
    files = {"file": ("temp_file_name", sample)}
    r = requests.post(REST_URL, headers=HEADERS, files=files)

# Add your code to error checking for r.status_code.

task_id = r.json()["task_id"]

# Add your code for error checking if task_id is None.

Örnek response:

{
    "task_id" : 1
}

Form parametreleri:

Durum kodları:


Revision #1
Created 4 January 2024 11:48:21 by Ertan Sözer
Updated 4 January 2024 11:50:01 by Ertan Sözer