1.0.10 • Published 10 years ago

ptth v1.0.10

Weekly downloads
8
License
ISC
Repository
github
Last release
10 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

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago