这是我的代码:
var content = fs.read('test/test.png');
var formData = new FormData();
var blob = new Blob([content], {type:'image/png'});
formData.append('picture',blob);
require('utils').dump(formData);
this.open("http://localhost:8080/dns_capcha", {
headers:{
'Content-type':'image/png'
},
method: 'post',
data:formData
});
使用此代码我收到此错误:
CasperError: open(): invalid request settings data value: [object FormData]
有人能告诉我在这段代码中做错了什么吗?