{"size": 1022, "ext": "js", "max_stars_repo_path": "app/main/client/angular/services/HttpService.js", "max_stars_repo_name": "mongcheng/jingcafe", "max_stars_repo_stars_event_min_datetime": "2021-07-09T16:42:49.000Z", "max_stars_repo_stars_event_max_datetime": "2021-07-09T16:42:49.000Z", "max_issues_repo_path": "app/main/client/angular/services/HttpService.js", "max_issues_repo_name": "mongche/jingcafe", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "app/main/client/angular/services/HttpService.js", "max_forks_repo_name": "mongche/jingcafe", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.44, "max_line_length": 56, "alphanum_fraction": 0.6428571429}

export default class HttpService {
	constructor($http, AuthService, CONSTANTS) {
		'ngInject';

		this.$http = $http;
		this.AuthService = AuthService
		this.CONSTANTS = CONSTANTS;
	}

	get(operation, params = {}, isCache = false) {
		if (params === true) {
			params = {};
			isCache = true;
		}

		return this.$http({
			url: operation,
			method: 'GET',
			params: params,
			paramSerializer: '$httpParamSerializerJQLike',
			// timeout: this.CONSTANTS.HTTP.REQUEST_TIMEOUT
		});
	}

	post(operation, params = {}) {
		params = this._extendCsrfParameters(params);
		return this.$http.post(operation, params);
	}

	put(operation, params = {}) {
		params = this._extendCsrfParameters(params);
		return this.$http.put(operation, params);
	}

	delete(operation, params = {}) {
		params = this._extendCsrfParameters(params);
		return this.$http.delete(operation, params);
	}

	_extendCsrfParameters(params) {
		return angular.extend(params, this.AuthService.csrf);
	}



}


