Skip to content

Instantly share code, notes, and snippets.

@taosx
taosx / fetchpostjson.js
Last active June 24, 2016 00:41
Use fetch to HTTP json
var payload = {
to: nameTo,
by: nameBy
};
fetch('/api/love/declare', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
@taosx
taosx / api.go
Last active April 21, 2016 15:29
Make it easy to add of new apis or replace existing ones
package main
import (
"fmt"
"log"
"net/url"
"strings"
"github.com/valyala/fasthttp"
)
@taosx
taosx / mithriljsonextract.js
Created May 27, 2015 09:43
Extract information from a json file using mithril m.request()
// MODEL
'use strict';
var m = require('mithril');
var config = module.exports = {};
config.himage = m.request({
method: 'GET',
url: '/config.json'
})