Skip to content

ronm/HTTP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Http

XMLHttpRequest Object

Usage

import Http from './Http'

or

<script type="text/javascript" src="http.js"></script>

then

var http = new Http();

http.get(url = 'string', data = {}).then(res => console.log(res));

Methods

get

new Http().get(url,data);

post

new Http().post(url,data);

delete

new Http().delete(url,data);

put

new Http().put(url,data);

jsonp

new Http().jsonp(url);

Options

Options are set when initializing the Http object.

headers: null (optional parameter)

object

var http = new Http({headers: {"Content-type": "application/x-www-form-urlencoded"}});

http.get(url = 'string', data = {})	.then(res => console.log(res));

About

A tiny ajax library with promises

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published