<commit_before># sync-request

Make synchronous web requests with cross platform support.

[![Build Status](https://img.shields.io/travis/ForbesLindesay/sync-request/master.svg)](https://travis-ci.org/ForbesLindesay/sync-request)
[![Dependency Status](https://img.shields.io/gemnasium/ForbesLindesay/sync-request.svg)](https://gemnasium.com/ForbesLindesay/sync-request)
[![NPM version](https://img.shields.io/npm/v/sync-request.svg)](https://www.npmjs.org/package/sync-request)

## Installation

    npm install sync-request

## Usage

```js
request(method, url, options)
```

e.g.

```js
var request = require('sync-request');
var res = request('GET', 'http://example.com');
console.log(res.getBody());
```

**Method:**

An HTTP method (e.g. `GET`, `POST`, `PUT`, `DELETE` or `HEAD`). It is not case sensitive.

**URL:**<commit_msg>Add example with options to the README file.<commit_after># sync-request

Make synchronous web requests with cross platform support.

[![Build Status](https://img.shields.io/travis/ForbesLindesay/sync-request/master.svg)](https://travis-ci.org/ForbesLindesay/sync-request)
[![Dependency Status](https://img.shields.io/gemnasium/ForbesLindesay/sync-request.svg)](https://gemnasium.com/ForbesLindesay/sync-request)
[![NPM version](https://img.shields.io/npm/v/sync-request.svg)](https://www.npmjs.org/package/sync-request)

## Installation

    npm install sync-request

## Usage

```js
request(method, url, options)
```

e.g.

- GET request without options

```js
var request = require('sync-request');
var res = request('GET', 'http://example.com');
console.log(res.getBody());
```

- GET request with options

```js
var request = require('sync-request');
var opt_obj = {
	'headers': {
		'user-agent': 'example-user-agent'
	}
};
var res = request('GET', 'https://example.com');
console.log(res.getBody());
```

**Method:**

An HTTP method (e.g. `GET`, `POST`, `PUT`, `DELETE` or `HEAD`). It is not case sensitive.

**URL:**
{'fraction_non_alphanumeric': 0.19683026584867075, 'fraction_numerical': 0.0, 'mean_word_length': 4.948328267477204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 13, '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': '5658673', 'n_tokens_mistral': 711, 'n_tokens_neox': 673, 'n_words': 132}