2 回答

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超4個(gè)贊
stream.fetch({
method: 'POST',
url: POST_URL,
type:'json',
body:JSON.stringify({username:'weex'})//or you can just use JSON Object {username:'weex'}
}, function(ret) {
if(!ret.ok){
me.postResult = "request failed";
}else{
console.log('get:'+JSON.stringify(ret));
me.postResult = JSON.stringify(ret.data);
}
},function(response){
console.log('get in progress:'+response.length);
me.postResult = "bytes received:"+response.length;
});

TA貢獻(xiàn)2080條經(jīng)驗(yàn) 獲得超4個(gè)贊
在請求頭中加入 "Content-Type": 'application/x-www-form-urlencoded;即可
- 2 回答
- 0 關(guān)注
- 1020 瀏覽
添加回答
舉報(bào)