當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Http.put方法代碼示例

本文整理匯總了TypeScript中@angular/http.Http.put方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Http.put方法的具體用法?TypeScript Http.put怎麽用?TypeScript Http.put使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/http.Http的用法示例。


在下文中一共展示了Http.put方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: updateSchedule

    updateSchedule(schedule: Schedule) : Observable<any> {
        
        let url = global.url + "api/Schedules/" + schedule.Id;

        let body = JSON.stringify(schedule);
        let headers = new Headers({ 'Content-Type': 'application/json' });
        let options = new RequestOptions({ headers: headers });        

        return this.http.put(url, body, options)                         
                        .catch(this.handleError);
    }
開發者ID:bjsmarts-beimar,項目名稱:NVSLONLINE,代碼行數:11,代碼來源:data.service.ts

示例2: updateSingleNews

    updateSingleNews(news: News) : Observable<any> {
        
        let url = global.url + "api/News/" + news.Id;

        let body = JSON.stringify(news);
        let headers = new Headers({ 'Content-Type': 'application/json' });
        let options = new RequestOptions({ headers: headers });        

        return this.http.put(url, body, options)                         
                        .catch(this.handleError);
    }
開發者ID:bjsmarts-beimar,項目名稱:NVSLONLINE,代碼行數:11,代碼來源:data.service.ts

示例3: put

 /**
  * Wrapper for HTTP PUT operation
  */
 public put(url: string, body?: string): Observable<any> {
     this._headers.set("Content-Type", "application/json");
     const options = new RequestOptions({headers: this._headers});
     if (body === null) {
       body = "";
     }
     return this._http
         .put(this._baseUrl + url, body, options)
         .map(response => this.mapResponse(response))
         .catch(error => this.handleError(error));
 }
開發者ID:EduCaMa,項目名稱:Showcase,代碼行數:14,代碼來源:rest-client.service.ts

示例4: updateDivision

    updateDivision(division: Division) : Observable<any> {
        
        let url = global.url + "api/Divisions/" + division.Id;

        let body = JSON.stringify(division);
        let headers = new Headers({ 'Content-Type': 'application/json' });
        let options = new RequestOptions({ headers: headers });        

        return this.http.put(url, body, options)                         
                        .catch(this.handleError);
    }
開發者ID:bjsmarts-beimar,項目名稱:NVSLONLINE,代碼行數:11,代碼來源:data.service.ts

示例5: updatePlayer

  updatePlayer(player: Player): any {
    let url = CONFIG.apiUrl + '/players/' + player.playerId;

    let body = JSON.stringify(player);
    let headers = new Headers({'Content-Type': 'application/json'});
    let options = new RequestOptions({headers: headers});

    return this.http.put(url, body, options)
        .map(res => res.json()[0])
        .catch(this.helperService.handleError);
  }
開發者ID:waffle-iron,項目名稱:Convocatorias-Bucaneros-Angular2,代碼行數:11,代碼來源:player.service.ts

示例6: modifyCustomer

 modifyCustomer(customer: Customer): Promise<User> {
     let body = JSON.stringify({ customer });
     let headers = new Headers({ 'Content-Type': 'application/json' });
     let options = new RequestOptions({ headers: headers });
     return this.http.put('api/customer', body, options)
         .toPromise()
         .then(response => {
             return response.json();
         })
         .catch(this.handleError);
 }
開發者ID:haochen21,項目名稱:ticketClient,代碼行數:11,代碼來源:security.service.ts

示例7: updateOrganization

    updateOrganization(organization: Organization) {
        let headers = this.getHeaders();

        // don't send userId as a parameter. The server validates the userId from the token in the header.
        let url = ROOT + '/Organization/Update';
        this.http.put(url, organization, { headers: headers })
            .subscribe((response: Response) => {
                this.cacheService.put(this.cacheKeys.Organization, null);
                this.emit(ServiceEvents.OrganizationUpdated);
            });
    }
開發者ID:busidex-vinbrown,項目名稱:orgadmin,代碼行數:11,代碼來源:organization.service.ts

示例8: setPass

 setPass(body: string, idUser: number, token): Observable<any> {
   const url = `${this.urlRecover }`;
   const headers = new Headers();
   headers.append('Content-Type', 'application/json');
   headers.append('Authorization', `Bearer ${token}`);
   const options = new RequestOptions({headers: headers, withCredentials: true});
   return this.http
     .put(url, body, options)
     .map(this.extractData)
     .catch(this.extractData);
 }
開發者ID:camilolozano,項目名稱:finalAndroid2018-front,代碼行數:11,代碼來源:recover-password.service.ts

示例9: stopTrip

 public stopTrip(trip:ITrip):Observable<ITrip> {
   console.log('stopping');
   console.log(JSON.stringify(trip));
   console.log(trip);
   console.log('done stopping');
   var headers = new Headers();
   trip.tripStatus = Trip.TRIP_STATUS_STOPPED;
   headers.append('Content-Type', 'application/json');
   return this.http.put(environment.API + '/trips/' + trip.id, JSON.stringify(trip), {headers: headers})
       .map(res => res.json());
 }
開發者ID:jojomay24,項目名稱:tripTracker,代碼行數:11,代碼來源:trips.service.ts

示例10: updateStudents

 updateStudents(code: string, students: string[]) {
   return this.http.put("/api/subject/" + code + "/students", JSON.stringify({students: students}), {
     headers: authHeaders()
   }).map((res) => {
     if (res.status === 200) {
       return true;
     } else {
       return false;
     }
   });
 }
開發者ID:Angularne,項目名稱:EduQ,代碼行數:11,代碼來源:subject.service.ts


注:本文中的@angular/http.Http.put方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。