JS Fetch use Chunked Transfer Encoding (translating curl to Fetch)

别等时光非礼了梦想. 提交于 2020-01-06 04:33:12

问题


I'm trying to convert this curl command from the Kaldi docs:

curl -v -T test/data/english_test.raw -H "Content-Type: audio/x-raw-int; rate=16000" --header "Transfer-Encoding: chunked" --limit-rate 32000  "http://localhost:8888/client/dynamic/recognize"

To JS code, specifically fetch. I'm able to POST a binary file using fetch pretty easily but specifically what I need to do is use chunked transfer encoding. To the life of me I can't find any docs on this, and as far as I know in JS, it's really up to the user agent to set the transfer encoding. Would appreciate any pointers!

来源:https://stackoverflow.com/questions/56264083/js-fetch-use-chunked-transfer-encoding-translating-curl-to-fetch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!