|
1 | 1 | (ns clj-http.test.client-test |
2 | 2 | (:require [cheshire.core :as json] |
| 3 | + [clj-commons.slingshot :refer [try+]] |
3 | 4 | [clj-http.client :as client] |
4 | 5 | [clj-http.conn-mgr :as conn] |
5 | 6 | [clj-http.test.core-test :refer [run-server]] |
6 | 7 | [clj-http.util :as util] |
7 | 8 | [clojure.java.io :as io :refer [resource]] |
8 | 9 | [clojure.string :as str] |
9 | | - [clojure.test :refer :all] |
| 10 | + [clojure.test :refer [deftest is testing]] |
10 | 11 | [cognitect.transit :as transit] |
11 | 12 | [ring.middleware.nested-params :refer [parse-nested-keys]] |
12 | | - [ring.util.codec :refer [form-decode-str]] |
13 | | - [slingshot.slingshot :refer [try+]]) |
| 13 | + [ring.util.codec :refer [form-decode-str]]) |
14 | 14 | (:import java.io.ByteArrayInputStream |
15 | 15 | java.io.PipedInputStream |
16 | 16 | java.io.PipedOutputStream |
|
507 | 507 | (doseq [method [:put :post :delete] |
508 | 508 | status [301 302 307 308]] |
509 | 509 | (let [client (fn [req] {:status status :body (:body req) |
510 | | - :headers {"location" "http://example.com/bat"}}) |
| 510 | + :headers {"location" "http://example.com/bat"}}) |
511 | 511 | r-client (client/wrap-redirects client) |
512 | 512 | resp (r-client {:body "ok" :url "http://example.com" |
513 | 513 | :request-method method})] |
|
1380 | 1380 | (fn [req] {:body nil})) {:decode-body-headers true}) |
1381 | 1381 | resp4 ((client/wrap-additional-header-parsing |
1382 | 1382 | (fn [req] {:headers {"content-type" "application/pdf"} |
1383 | | - :body (.getBytes text)})) |
| 1383 | + :body (.getBytes text)})) |
1384 | 1384 | {:decode-body-headers true})] |
1385 | 1385 | (is (= {"content-type" "text/html; charset=Shift_JIS" |
1386 | 1386 | "content-style-type" "text/css" |
|
0 commit comments