Skip to content

Instantly share code, notes, and snippets.

@ajcrites
Last active August 29, 2015 14:23
Show Gist options
  • Save ajcrites/3aff287fa6aa5b33c097 to your computer and use it in GitHub Desktop.
Save ajcrites/3aff287fa6aa5b33c097 to your computer and use it in GitHub Desktop.
import request from "request-promise";
import {readFile, writeFile} from "mz/fs";
let uri = "http://localhost:8917";
async () => {
let body = await request.get({uri});
await writeFile(__dirname + "/foo", body);
let contents = await readFile(__dirname + "/foo");
await writeFile(__dirname + "/bar", contents.toString().split("").reverse().join(""));
let res = await request({uri, method: "POST"});
console.log(res);
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment