2016-09-13 10 views
1

私はポストウィットangle2でサービスを利用しようとしています。この私のコード:httpポストで角2のURLを符号化しました

var m_dataRequest = this.buildLoginUserPasswordRequest(password, key); 
    let headers = new Headers({ 
     'Accept': '*/*', 
     'Accept-Encoding': 'gzip, deflate, br', 
     'Accept-Language': 'es-ES,es;q=0.8,en;q=0.6', 
     'Content-Type': 'application/x-www-form-urlencoded', 
     }); 

     let options = new RequestOptions({ headers: headers }); 
     let body = new URLSearchParams(); 

     body.set("message", JSON.stringify(m_dataRequest)); 
     body.set("webService", "authService"); 

      return this.http 
       .post(this.Url, body.toString(), options) 
       .toPromise() 
       .then(this.extractData) 
       .catch(this.handleError); 

     private buildLoginUserPasswordRequest(password:string, key:string): any { 

     var m_dataRequest = { 
        "ser:nativeAppAuth": { 
         "-xmlns:ser": "http://services.mobileappbc.ws.todo1.com/", 
         "password": this.utilService.buidRSAPass(password, t1Assertion), 
         "key": key, 
         "deviceInfo": this.utilService.getDeviceInfo() 
        } 
       }; 
     return m_dataRequest; 
    } 

コンテンツタイプのバックエンドは、この方法の情報を必要とするため、アプリケーション/ x-www-form-urlencodedです。 私の問題は文字 ":"が同等のurlencoded%3A +に変換されないということです。 これは私のバックエンドサービスで問題を引き起こします。

これを解決するための提案はありますか? ありがとう!

答えて

関連する問題