Curl Http Post Binary File

摘要:Curl Http Post Binary File

以 http post 的方式傳送檔案至 http server

curl -X POST --data-binary "@test.pcm" -H "Content-Type: application/octet-stream" "http://mypc:8080/hello/login?utterance=good&confidence=0.7"
另一個例子是使用google speech api

curl -k -X POST --data-binary "@test.wav" -H "Content-Type: audio/L16; rate=16000" "https://www.google.com/speech-api/v2/recognize?xjerr=1&client=chromium&lang=zh-tw&maxresults=1&pfilter=0&key=Your_APP_ID"