<commit_before>import * as Http from 'superagent';

/**
 * Abstraction of the isso comment server. This is the server storing the
 * comments. All requests will be sent to it.
 */
export default class IssoServer {

	/**
	 * URL of the isso server.
	 */
	private baseUrl: string;

	/**
	 * Creates a server that can be reached at the provided `url`. There should
	 * usually be only one instance of this class.
	 *
	 * @param url	The url of the isso server to communicate with.
	 */
	constructor(baseUrl: string) {
		this.baseUrl = baseUrl.charAt(baseUrl.length - 1) === '/' ? baseUrl.substr(0, baseUrl.length - 1) : baseUrl;
	}

	/**
	 * Builds a HTTP GET request for the provided `endpoint`.
	 *
	 * @hidden
	 * @param endpoint	The enpoint URI, relative to this server’s base URL. Must start with a `/`.
	 * @return A request object to `GET` on `endpoint`.
	 */
	public get(endpoint: string): Http.Request<any> {
		return Http.get(this.baseUrl + endpoint);
	}

	/**
	 * Builds a HTTP POST request for the provided `endpoint`.
	 *
	 * @hidden
	 * @param endpoint
	 *		The enpoint URI, relative to this server’s base URL. Must start with a `/`.
	 * @return A request object to `POST` on `endpoint`.
	 */
	public post(endpoint: string): Http.Request<any> {
		return Http.post(this.baseUrl + endpoint);
	}

	/**
	 * Builds a HTTP PUT request for the provided `endpoint`.
	 *
	 * @hidden
	 * @param endpoint	The enpoint URI, relative to this server’s base URL. Must start with a `/`.
	 * @return A request object to `PUT` on `endpoint`.
	 */
	public put(endpoint: string): Http.Request<any> {
		return Http.put(this.baseUrl + endpoint);
	}

	/**
	 * Builds a HTTP DELETE request for the provided `endpoint`.
	 *
	 * @hidden
	 * @param endpoint	The enpoint URI, relative to this server’s base URL. Must start with a `/`.
	 * @return A request object to `DELETE` on `endpoint`.
	 */
	public delete(endpoint: string): Http.Request<any> {
		return Http.del(this.baseUrl + endpoint);
	}
}<commit_msg>Set the content type on post requests.<commit_after>import * as Http from 'superagent';

/**
 * Abstraction of the isso comment server. This is the server storing the
 * comments. All requests will be sent to it.
 */
export default class IssoServer {

	/**
	 * URL of the isso server.
	 */
	private baseUrl: string;

	/**
	 * Creates a server that can be reached at the provided `url`. There should
	 * usually be only one instance of this class.
	 *
	 * @param url	The url of the isso server to communicate with.
	 */
	constructor(baseUrl: string) {
		this.baseUrl = baseUrl.charAt(baseUrl.length - 1) === '/' ? baseUrl.substr(0, baseUrl.length - 1) : baseUrl;
	}

	/**
	 * Builds a HTTP GET request for the provided `endpoint`.
	 *
	 * @hidden
	 * @param endpoint	The enpoint URI, relative to this server’s base URL. Must start with a `/`.
	 * @return A request object to `GET` on `endpoint`.
	 */
	public get(endpoint: string): Http.Request<any> {
		return Http.get(this.baseUrl + endpoint);
	}

	/**
	 * Builds a HTTP POST request for the provided `endpoint`.
	 *
	 * @hidden
	 * @param endpoint
	 *		The enpoint URI, relative to this server’s base URL. Must start with a `/`.
	 * @return A request object to `POST` on `endpoint`.
	 */
	public post(endpoint: string): Http.Request<any> {
		return Http.post(this.baseUrl + endpoint)
			.set('Content-Type', 'application/json');
	}

	/**
	 * Builds a HTTP PUT request for the provided `endpoint`.
	 *
	 * @hidden
	 * @param endpoint	The enpoint URI, relative to this server’s base URL. Must start with a `/`.
	 * @return A request object to `PUT` on `endpoint`.
	 */
	public put(endpoint: string): Http.Request<any> {
		return Http.put(this.baseUrl + endpoint);
	}

	/**
	 * Builds a HTTP DELETE request for the provided `endpoint`.
	 *
	 * @hidden
	 * @param endpoint	The enpoint URI, relative to this server’s base URL. Must start with a `/`.
	 * @return A request object to `DELETE` on `endpoint`.
	 */
	public delete(endpoint: string): Http.Request<any> {
		return Http.del(this.baseUrl + endpoint);
	}
}
{'fraction_non_alphanumeric': 0.12268575660330783, 'fraction_numerical': 0.0014811157738829918, 'mean_word_length': 3.2384937238493725, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, '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': '2593904', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1205, 'n_words': 484}