私はangular2でポストWebサービスを実装しようとしています。 私は郵便配達員とその働きによってURLにヒットしようとしました。しかし、角度で実装しようとしているとき、私は何の反応も得ていません。angular2を使用したイオン2でのポストWebサービスの実装
がload(username, password) {
console.log(username," ", password);
let postData = {"username":username, "password" : password,
"userdeviceInfo": [{
"deviceId": "APA91bGUZuKVbqur7Qq2gy2eyomWgXkIU5Jcmmtmgl4IGuzVzwiJVMZgAHj3Bx6yrnW0oEZlEtB9XdcR6AOpKyEMVSWwQ_UIfNX6T0iwq28hnufOhauVdTYZQSWWPAdDrdg58cjnL5T-",
"platform":"Android"
}]};
//let body= JSON.stringify(postData);
//console.log("body---"+body)
this.headers = new Headers();
this.headers.append("Content-Type", 'application/json');
this.requestoptions = new RequestOptions({
method: RequestMethod.Post,
url: this.url,
headers: this.headers,
body: JSON.stringify(postData)
})
console.log("body---"+this.requestoptions)
return this.http.request(new Request(this.requestoptions))
.map((res: Response) => {
if (res) {
console.log(res.json());
return [{ status: res.status, json: res.json() }];
}})
.subscribe(res => this.data = res);
私はrecievingてるのエラーがある:私は一種のここにこだわって
XMLHttpRequest cannot load "MY_URL". Response for preflight has invalid HTTP status code 500
次 は私のコードサンプルです。誰かが私がどこに間違っているのか見つけるのを助けることができる?ここ
'レスポンスが、これは私がそれを –
で無効なHTTPステータスコード500'を持っていますサービスは正常に実行されています –
私の取得を無効にすることにより、CORSの問題を取り扱う可能性がCORSの問題 –