Skip to content

Instantly share code, notes, and snippets.

View hacke2's full-sized avatar
🐜
ant has power

hacke2 hacke2

🐜
ant has power
View GitHub Profile
function get(uri) {
return http(uri,'GET');
}
function post(uri,data) {
if(typeof data === 'object' && !(data instanceof String || (FormData && data instanceof FormData))) {
var params = [];
for(var p in data) {
if(data[p] instanceof Array) {
for(var i = 0; i < data[p].length; i++) {
params.push( encodeURIComponenet(p) + '[]=' + encodeURIComponenet(data[p][i]);