<commit_before>import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import {Subject} from 'rxjs/Subject';
import 'rxjs/add/operator/map';
import {Router} from '@ngrx/router';
import {AuthHttp} from 'angular2-jwt';
import {Hotel} from '../model/backend-typings';

@Injectable()
export class HotelService {

  constructor(private http: Http, private authHttp: AuthHttp, private router: Router) {
  }

  getHotels(): Observable<Hotel[]> {
    // const queryUrl: string = `http://localhost:8080/rest/hotels`;
    const queryUrl = `http://beta.json-generator.com/api/json/get/NkpdDDTeb`;
    return this.http.get(queryUrl)
      .map((res: Response) => res.json());
  }

  getHotelsAuthenticated(): Observable<Hotel[]> {
    const queryUrl: string = `http://localhost:8080/rest/hotels`;

    let hotelsSubject = new Subject<Response>();<commit_msg>Try https for rest data fetching.<commit_after>import {Injectable} from '@angular/core';
import {Http, Response} from '@angular/http';
import {Observable} from 'rxjs/Observable';
import {Subject} from 'rxjs/Subject';
import 'rxjs/add/operator/map';
import {Router} from '@ngrx/router';
import {AuthHttp} from 'angular2-jwt';
import {Hotel} from '../model/backend-typings';

@Injectable()
export class HotelService {

  constructor(private http: Http, private authHttp: AuthHttp, private router: Router) {
  }

  getHotels(): Observable<Hotel[]> {
    // const queryUrl: string = `http://localhost:8080/rest/hotels`;
    const queryUrl = `http://beta.json-generator.com/api/json/get/NkpdDDTeb`;
    return this.http.get(queryUrl)
      .map((res: Response) => res.json());
  }

  getHotelsAuthenticated(): Observable<Hotel[]> {
    const queryUrl: string = `https://localhost:8080/rest/hotels`;

    let hotelsSubject = new Subject<Response>();
{'fraction_non_alphanumeric': 0.16032171581769436, 'fraction_numerical': 0.0096514745308311, 'mean_word_length': 4.813084112149533, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6802258', 'n_tokens_mistral': 611, 'n_tokens_neox': 596, 'n_words': 140}