Example #1
0
	getPlanets(): Observable<Planet[]> {
		return this.http.get('http://swapi.co/api/planets/')
			.map(this.extractData)
			.catch(this.handleError)
	}
	getComentariosEvento(id:number){
		return this.http.get(URL+id)
	      .map(response => response.json())
	      .catch(error => this.handleError(error));
	}
Example #3
0
 getBooks(): Observable<any> {
     return this.http.get(this.baseUrl).map(response => response.json());
 }
Example #4
0
 get_req(url: string, options?: Object) : any {
     var url = this.query(url, options);
     return this.http.get(url)
       .map((res: Response) => res.json());
 }
Example #5
0
 insert(doc) : any {
     return this.http.post("/contacts", JSON.stringify(doc))
         .map((res: Response) => res.json());
 }
Example #6
0
	GetMatches()
	{
		return this.http.get('/rest/match');
	}
 getResume(){
     return this._http.get("http://api.steve-botello.com/resume").map(r => r.json())
 }
 updateItem(item:Item) {
     this.http.put(`${BASE_URL}${item.id}`, JSON.stringify(item), HEADER)
         .subscribe(action => this.store.dispatch({type: 'UPDATE_ITEM', payload: item}));
 }
 deleteItem(item:Item) {
     this.http.delete(`${BASE_URL}${item.id}`)
         .subscribe(action => this.store.dispatch({type: 'DELETE_ITEM', payload: item}));
 }
 loadAllItems() {
     this.http.get(BASE_URL)
         .map(res => res.json())
         .map(payload => ({type: 'ADD_ITEMS', payload}))
         .subscribe(action => this.store.dispatch(action));
 }
 createItem(item:Item) {
     this.http.post(`${BASE_URL}`, JSON.stringify(item), HEADER)
         .map(res => res.json())
         .map(payload => ({type: 'CREATE_ITEM', payload}))
         .subscribe(action => this.store.dispatch(action));
 }
Example #12
0
 getSession(slug: string): Observable<Session> {
   return this.http.get('/assets/json/sessions.json')
     .map(data => data.json())
     .map(data => data.hasOwnProperty(slug) ? data[slug] : undefined);
 }
Example #13
0
 fetchPosts(reddit : string){
     return this.http
         .get(`https://www.reddit.com/r/${reddit.replace(' ', '')}.json`)
         .map(response => response.json());
 }
Example #14
0
 fetchLanguages(): Observable<ILanguage[]> {
   return this._http.get(BASE_URL + 'languages').map(res => res.json());
 }
Example #15
0
 create(comp:Competition) {
     return this._http.post(BASE_URL + '/auth/competition', JSON.stringify(comp), {
         headers: json()
     });
 }
 getQuestionsNo() {
   return this.http.get("/app/json/questionsNo.json").map((res: Response) => res.json());
 }
Example #17
0
 saveSelectionForComp(compId:String, selection:Selection):Observable<Response> {
     // /auth/ URLs are protected by the middleware
     return this._http.post(BASE_URL + '/auth/competition/selection/push/' + compId, JSON.stringify(selection), {
         headers: json()
     });
 }
 getStories(page,count,type) {
     let stories = this.http.get(`https://handbagdesigner101.com/story/mobile/${page}/${count}/${type}`);
     return stories;
 }
 getOrders() { //: Observable<Order[]> {
     return this._http.get(API_BASE + `/order`)
         .map((response: Response) => response.json());
 }
Example #20
0
 getData() {
   const url: string = 'http://localhost:1337/marta';
   // var url = 'http://developer.itsmarta.com/BRDRestService/BRDRestService.svc/GetAllBus';
   this._http.get(url).subscribe(data => this.data = JSON.stringify(data));
 }
Example #21
0
 getFacilities():Observable<any> {
     return this._http.get('http://localhost:8000/api/facilities')
         .map(res => res.json());
 }
Example #22
0
    /*
     return this._http.get("https://script.google.com/macros/s/AKfycbzFucS-ofVyvJI8RamqIfS1YW8WvNfDVZjb_3HwdttDpmQPcfaX/exec?id=1MuVFBugwi8iFyNTE0owsUgeNA9V3FkEAEkQqHzBFbo8&sheet=response")
    * This method retrieves the data from Google Spredsheet*/
    getUserData(date){
return this._http.get("https://script.google.com/macros/s/AKfycbyfBnFvqpjRav282f7HBOd8OLVTsVqD7_wwQQUuWJhU5J31MLrH/exec?sheet=Sheet1&date="+date)
        // return this._http.get("https://script.google.com/macros/s/AKfycbyfBnFvqpjRav282f7HBOd8OLVTsVqD7_wwQQUuWJhU5J31MLrH/exec?id=1aaHVsv7wg1J8Sn6OCLVbezMVn81BctsxEHBhLNrC7G8&sheet=response&date="+date)
            .map(res=>res.json());
    };
Example #23
0
 delete(id: string, rev: string) : any {
     var url = this.query("/contacts/" + id, {rev: rev});
     return this.http.delete(url);
 }
Example #24
0
 createCommunity(community: ICommunity) {
   this._http.post(`${BASE_URL}`, JSON.stringify(this.addUUID(community)), HEADER)
       .subscribe(action => this.store.dispatch({type: 'CREATE_COMMUNITY', payload: event}));
 }
    getComentarios(){
		return this.http.get(URL)
	      .map(response => response.json())
	      .catch(error => this.handleError(error));
	}
Example #26
0
 updateCommunity(community: ICommunity) {
   this._http.put(`${BASE_URL}${community.id}`, JSON.stringify(community), HEADER)
       .subscribe(action => this.store.dispatch({type: 'UPDATE_COMMUNITY', payload: event}));
 }
 update(id: string, customerDetails: CustomerDetails) {
   let param: { [s: string]: CustomerDetails } = { 'customer': customerDetails };
   return this._http
              .put('/customer/' + id, JSON.stringify(param));
 }
    constructor (public http:Http,public catalog: PlantCatalogService) {
        this.http.get("http://localhost:8090/api/sales/rentit/orders")
            .subscribe(resp => this.orders = resp.json());


    }
Example #29
0
 constructor(http: Http, routeParam: router.RouteParams) {
     http.get('/api/albums/' + routeParam.params['albumId']).subscribe(result => {
         this.albumData = result.json();
     });
 }
Example #30
0
 getHeroes() {
   return this.http.get(`api/heroes`)
     .map((res: Response) => res.json().data);
 }