Skip to content

Instantly share code, notes, and snippets.

@maiha maiha/run.md
Last active Feb 10, 2019

Embed
What would you like to do?
$ curl -H 'Accept-Encoding: gzip' http://staff.livedoor.blog/ > x1
$ crystal test.cr > x2

$ LC_ALL=C ls -l x1 x2
-rw-rw-r-- 1 maiha maiha 13786 Feb 10 10:00 x1
-rw-rw-r-- 1 maiha maiha 13602 Feb 10 10:06 x2

$ file x1 x2
x1: gzip compressed data, last modified: Sun Feb 10 01:00:48 2019, from Unix
x2: data

$ crystal --version
Crystal 0.27.0 [c9d1eef8f] (2018-11-01)

LLVM: 4.0.0
Default target: x86_64-unknown-linux-gnu
require "http/client"
client = HTTP::Client.new("staff.livedoor.blog")
headers = HTTP::Headers{"Accept-Encoding" => "gzip"}
print client.get("/", headers).body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.