<commit_before>import { Injectable } from '@angular/core';
import {
  Http,
  Response,
  Headers,
  RequestOptions
} from '@angular/http';
import { Observable } from 'rxjs/Observable';
import { ErrorInterface } from '../state/index';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observable/throw';

@Injectable()
export class LoaderService {
  private options:RequestOptions;
  constructor(protected http:Http) {
    this.options = new RequestOptions({
      headers: new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' })
    });
  }

  get(url:string, type:LoaderDataTypeEnum = LoaderDataTypeEnum.JSON):Observable<string[]> {
    return this.http.get(url)
      .map((res:Response) => this.getResponse(res, type))
      .catch((error) => this.handleError(error));
  }

  post(url:string, params:any):Observable<string[]> {
    return this.http.post(url, params, this.options)
      .map((res:Response) => res.json())<commit_msg>Added CSV support for POST call.<commit_after>import { Injectable } from '@angular/core';
import {
  Http,
  Response,
  Headers,
  RequestOptions
} from '@angular/http';
import { Observable } from 'rxjs/Observable';
import { ErrorInterface } from '../state/index';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import 'rxjs/add/observable/throw';

@Injectable()
export class LoaderService {
  private options:RequestOptions;
  constructor(protected http:Http) {
    this.options = new RequestOptions({
      headers: new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' })
    });
  }

  get(url:string, type:LoaderDataTypeEnum = LoaderDataTypeEnum.JSON):Observable<string[]> {
    return this.http.get(url)
      .map((res:Response) => this.getResponse(res, type))
      .catch((error) => this.handleError(error));
  }

  post(url:string, params:any, type:LoaderDataTypeEnum = LoaderDataTypeEnum.JSON):Observable<string[]> {
    return this.http.post(url, params, this.options)
      .map((res:Response) => this.getResponse(res, type))
{'fraction_non_alphanumeric': 0.15489527520701413, 'fraction_numerical': 0.0, 'mean_word_length': 4.642857142857143, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6193918', 'n_tokens_mistral': 648, 'n_tokens_neox': 647, 'n_words': 125}