ufna / VaRest

REST API plugin for Unreal Engine 4 - we love restfull backend and JSON communications!
https://www.unrealengine.com/marketplace/en-US/product/varest-plugin
MIT License
1.05k stars 289 forks source link

How can I Request binary file #424

Open JiyoonLee18 opened 8 months ago

JiyoonLee18 commented 8 months ago

In Unreal Engine, I want to send request using wav file and I wrote it in python like below How can I request binary file or wav file?

import json
import requests

config = {}
resp = requests.post(
    'https://openapi.vito.ai/v1/transcribe',
    headers={'Authorization': 'bearer '+token},
    data={'config': '{}'},
    files={'file':open('hello.wav', 'rb')}
)
resp.raise_for_status()
print(resp.json())