我尝试发送此json到我的php服务器{"obj":{"r": "hello", "u": "[email protected]", "p": "123abc"}}
。angular2 http post变换。在_
当我发送,我的服务器收到{"obj":{"r": "hello", "u": "[email protected]_com", "p": "123abc"}}
,我不明白为什么。
这里是我的角度代码:
data = {"obj":{"r": "hello", "u": "[email protected]", "p": "123abc"}};
postMethod(data): Observable<any> {
let headers = new Headers();
this.createAuthorizationHeader(headers);
console.log(JSON.stringify(data));
return this._http.post(this.serverUrl, JSON.stringify(data), {headers: headers})
.map((response:Response) => response.json())
.catch(this.handleError);
}
比你的男人是神 –