Skip to content

change http://http-kit.org to http://http-kit.github.io #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions _posts/2013-02-05-http-kit-clean-small.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ status: publish
title: http-kit is clean and small, less is exponentially more
---

* [HTTP server](http://http-kit.org/server.html): event-driven, ring adapter, websocket extension, asynchronous extension
* [HTTP Client](http://http-kit.org/client.html): event-driven, asynchronous with promise, synchronous with @promise, keep-alive
* [Timer facility](http://http-kit.org/timer.html)
* [HTTP server](http://http-kit.github.io/server.html): event-driven, ring adapter, websocket extension, asynchronous extension
* [HTTP Client](http://http-kit.github.io/client.html): event-driven, asynchronous with promise, synchronous with @promise, keep-alive
* [Timer facility](http://http-kit.github.io/timer.html)


All the above + high concurrency + high performance + nice API + written from scrach = ~3K lines of code.
Expand All @@ -35,3 +35,4 @@ Less is exponentially more
*cloc runned time: Tue Feb 5 23:23:58 CST 2013, on master branch, from src directory*

*Edit: 2013/3/29 with release 2.0.0, the codebase is slightly larger: 2970 lines of Java, 266 lines of Clojure*
*Edit: 2021/6/14: fix URLs*
16 changes: 8 additions & 8 deletions client.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h3 class="anchor" id="combined">Combined, concurrent requests, handle results
<p>Send request concurrently, with half the waiting time</p>

{% highlight clojure %}
(let [resp1 (http/get "http://http-kit.org/")
(let [resp1 (http/get "http://http-kit.github.io/")
resp2 (http/get "http://clojure.org/")]
(println "Response 1's status: " (:status @resp1)) ; wait as necessary
(println "Response 2's status: " (:status @resp2)))
Expand All @@ -82,11 +82,11 @@ <h3 class="anchor" id="reuse">Persistent connection</h3>
That can be configured by the <code>keepalive</code> option:</p>
{% highlight clojure %}
; keepalive for 30s
@(http/get "http://http-kit.org" {:keepalive 30000})
@(http/get "http://http-kit.github.io" {:keepalive 30000})
; will reuse the previous TCP connection
@(http/get "http://http-kit.org" {:keepalive 30000})
@(http/get "http://http-kit.github.io" {:keepalive 30000})
; disable keepalive for this request
@(http/get "http://http-kit.org" {:keepalive -1})
@(http/get "http://http-kit.github.io" {:keepalive -1})
{% endhighlight %}

<h3 class="anchor" id="state">Pass state to asynchronous callback</h3>
Expand All @@ -100,7 +100,7 @@ <h3 class="anchor" id="state">Pass state to asynchronous callback</h3>

;;; save state for callback, useful for async request
(let [opts {:start-time (System/currentTimeMillis)}]
(http/get "http://http-kit.org" opts callback))
(http/get "http://http-kit.github.io" opts callback))
{% endhighlight %}

<h3 class="anchor" id="coercion">Output coercion</h3>
Expand Down Expand Up @@ -157,7 +157,7 @@ <h3 class="anchor" id="nested-params">Nested params</h3>
<h3 class="anchor" id="options">Various options</h3>
{% highlight clojure %}

(http/request {:url "http://http-kit.org/"
(http/request {:url "http://http-kit.github.io/"
:method :get ; :post :put :head or other
:user-agent "User-Agent string"
:oauth-token "your-token"
Expand Down Expand Up @@ -194,8 +194,8 @@ <h3 class="anchor" id="faking">Faking Responses in Tests</h3>
</p>
{% highlight clojure %}

(with-fake-http ["http://http-kit.org/" "a fake response"]
(http/get {:url "http://http-kit.org/"})) ; promise wrapping the faked response
(with-fake-http ["http://http-kit.github.io/" "a fake response"]
(http/get {:url "http://http-kit.github.io/"})) ; promise wrapping the faked response

{% endhighlight %}

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h3>HTTP Server <a class="more" href="server.html">documentation</a></h3>
<h3>HTTP Client <a class="more" href="client.html">documentation</a></h3>
{% highlight clojure %}
;; start concurrent requests, get promise, half the waiting time
(let [response1 (http-kit/get "http://http-kit.org/")
(let [response1 (http-kit/get "http://http-kit.github.io/")
response2 (http-kit/get "http://clojure.org/")]
;; Handle responses one-by-one, blocking as necessary
;; Other keys :headers :body :error :opts
Expand Down