我想送的formData
,從圖像流我開始使用request消防GET請求,並得到節點流
的問題是,該請求是formData
請求後起火。 有沒有什麼辦法可以讓圖像請求識別?但是可以自由地將參數添加到formData
?
如:
var req = request({
method: 'POST',
url: 'http://www.foo.bar/api/v1/tag/recognize',
formData: {
image_file: request('http://visual-recognition-demo.mybluemix.net/images/horses.jpg'),
param2: 'value2'
},
json: true,
});
如何火:
request('http://visual-recognition-demo.mybluemix.net/images/horses.jpg')
這樣的反應可以在req
使用
UPDATE:好像Content-Length
頭在
失蹤 http://visual-recognition-demo.mybluemix.net/images/horses.jpg迴應
,你只能得到Transfer-Encoding: chunked
更多細節here
我不知道的是,'request'庫將允許您通過這個管道,而是你得到的也使用原始請求返回的正文進行回調。 – 2015-03-13 19:55:11
我認爲這應該在請求庫中處理。如果在第一個響應中未指定「content-length」,則會發生 – 2015-03-31 14:46:44