JS Fetch use Chunked Transfer Encoding (translatin

2019-08-20 03:45发布

问题:

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!