0.2.10 • Published 5 years ago

k-http v0.2.10

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

k-http

Easy http based on k-xhr

Installation

Node

npm install k-http

Browser

<script src="node_modules/k-http/dist/k-http.min.js"></script>

QuickStart

import kHttp from 'k-http'

kHttp
    .get('/example.json')
    .then(o => console.log(Object.keys(o))) // o will be the parsed object
    .catch(e => console.error(e)) // e will be the responseText or status code
    .finally(() => console.log('http request finished'))

Methods

  • get(url: String, [options: Object])

  • post(url: String, [data: Any], [options: Object])

  • put(url: String, [data: Any], [options: Object])

  • del(url: String, [options: Object])

  • then(h: Function)

  • catch(h: Function)

  • finally(h: Function)

options are the same as k-xhr

0.2.10

5 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago