1.0.10 • Published 7 years ago

ptth v1.0.10

Weekly downloads
8
License
ISC
Repository
github
Last release
7 years ago

ptth

A simple http client with middleware for the browser

Installation

npm install --save ptth

Or grab the script from the build folder.

Code Example

ptth.use(function(res, next) {
	console.log(res.status);
	next();
});

ptth('http://swapi.co/api/starships')
	.header('content-type', 'application/json')
	.params('page', '2')
	.data({ 'form': 'data' })
	.post(function(res) {
		if (res.ok) {
			console.log(res.body);
		}
	});

// logs response status code and body of the response

API Reference

See the docs.

License

MIT

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago