我尝试使用angular2发布数据但是当我试图发布时我有400个错误请求...在邮递员中测试,everthing是可以的,我有200并且成功
但是,有了angular2
我有一个400坏请求我做错了什么?谢谢 !
我的代码.服务调用API:
userAddReview(paramsObj) {
let headers = new Headers();
headers.append('Content-Type', 'application/json; charset=UTF-8');
let params = this.util.transformRequest(paramsObj);
console.log('sending request');
return this.authHttp.post(this.wpApiURL + '/users-reviews/reviews?' + params, JSON.stringify({}), { headers: headers })
.map(
res => {
let newReview = res.json();
this.reviews.push(newReview);
console.log(this.reviews);
return newReview;
}
);
}
Run Code Online (Sandbox Code Playgroud)
发布组件:
submitReview(form) {
console.log(this.review, form);
let params = {
id: this.review.post,
user_id: this.wp.getCurrentAuthorId(),
name: this.wp.getCurrentAuthorId(),
email: this.wp.getCurrentAuthorId(),
title: this.review.rating_title,
description: this.review.rating_comment,
rating: this.review.rating_score,
};
console.log("Review", params);
this.review.author = this.wp.getCurrentAuthorId();
this.wp.userAddReview(params)
.subscribe(
data => …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在一个工作表中获取多个列并将其复制到另一个中。使用getRange 函数,有没有办法获取和复制(例如):Col1、Col3、Col7?(而且我不太乐意为此使用查询......)
谢谢 !