Skip to content

Instantly share code, notes, and snippets.

@amit4111989
Last active January 19, 2017 13:56
Show Gist options
  • Save amit4111989/bbf269ea53f5024894d4f60c51e479f1 to your computer and use it in GitHub Desktop.
Save amit4111989/bbf269ea53f5024894d4f60c51e479f1 to your computer and use it in GitHub Desktop.
with open(tmp_path + 'recording.wav') as inf:
files = [
('file', ('request', json.dumps(data), 'application/json; charset=UTF-8')),
('file', ('audio', inf, 'audio/L16; rate=16000; channels=1'))
]
resp = requests.post(url, headers=headers, files=files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment