- Fixed empty ciphersuite list when compiling against
tls < 2.0.6
(see PR 175). As a side effect, now compatible with older versions ofcrypton-connection
(>= 0.3).
- Works with
crypton-connection-0.4
and newer.
- Disable the problematic
httpbin-tests
test suite by default. Only enable it when thedev
flag is enabled. In that case it is expected that an httpbin server is run locally atlocalhost:1234
.
-
Switched the non-pure test suite to use https://httpbun.org instead of https://httpbin.org since the latter proved to be highly unreliable lately.
-
Switched from
connection
tocrypton-connection
. -
Builds with GHC 9.6.1.
- Add
headerRedacted
function to add header fields, which will be with redacted values on print.
- Add
isStatusCodeException
function. - Add
instance HttpResponse (Network.HTTP.Client.Response ())
.
- Add the
queryParamToList
method to theQueryParam
type class. - Add the
formToQuery
function. Issue 126. - Add
FromForm
instances (in theWeb.FormUrlEncoded
module) to theOption
andFormUrlEncodedParam
types.
- Add
MonadHttp
instances fortransformers
types.
- The test suite works with
aeson-2.x.x.x
.
- Builds with GHC 9.0.
- The
useHttpURI
anduseHttpsURI
functions now preserve trailing slashes.
- Adjusted the value of the
httpConfigRetryJudgeException
field ofdefaultHttpConfig
to retry on response timeouts and connection timeouts.
-
Added
reqCb
, a function that allows you to modify theRequest
object but otherwise performs the requst for you. -
Derived
MonadThrow
,MonadCatch
, andMonadMask
for theReq
monad.
- Added the
httpConfigBodyPreviewLength
configuration parameter toHttpConfig
.
- Made
Req
an instance ofMonadUnliftIO
. Issue 100.
-
Requests using
DELETE
method can now have a body. Issue 89. -
Added the
httpConfigRetryJudgeException
field toHttpConfig
so that requests that result in exceptions can be retried. Issue 93. -
Added the function
renderUrl
. Issue 83.
- Derived
Show
instances for response typesIgnoreResponse
,JsonResponse
,BsResponse
, andLbsResponse
.
-
Made the tests pass with
http-client-0.7
and later. -
Added a quasiquoter for URL creation,
urlQ
.
- Changed signature of
httpConfigRetryPolicy
toRetryPolicyM IO
.
-
Dropped functions
parseUrlHttp
,parseUrlHttps
, andparseUrl
. Instead we now haveuseHttpURI
,useHttpsURI
, anduseURI
takeURI
s frommodern-uri
as their argument. You first parse your URL with themodern-uri
package and then pass it to those functions. This allows us to work with typed URI representations and seamlessly convert them to somethingreq
can work with. As a side effect basic auth from theURI
s is now taken into consideration. In the future we may also start to respect fragments ifhttp-client
starts to support this. -
Dropped support for GHC 8.2 and older.
-
Dropped support for GHC 7.10.
-
Added the new
acceptHeader
method to theHttpResponse
type class. Notably, thejsonResponse
method now sets"Accept"
header to"application/json"
.
- Fixed the
httpbin
tests (they changed something on the server again).
- Got rid of
data-default-class
dependency, now we exportdefaultHttpConfig
instead.
- Fixed a typo in the type signature of
parseUrl
.
- Added the
parseUrl
function.
-
Added
customAuth
andattachHeader
to facilitate creation of custom authentication options. -
Added
basicProxyAuth
authentication option.
-
Added the
reqBr
function allowing to consumeResponse BodyReader
without using a pre-defined instance ofHttpResponse
, in a custom way. -
Now streaming of response body does not happen until we've checked headers and status code with
httpConfigCheckResponse
. It also doesn't happen on every retry. Streaming and obtaining of final response value happens only once when we're happy with everything.Previously we first tried to consume and interpret response body before checking status code and determining whether we should retry the request. This was not good, because we could expect a JSON response but get a response with status code 500, and then still we would try to parse it as JSON first before letting
httpConfigCheckResponse
throw an exception.The corrected behavior should also make retrying more efficient.
-
Changed signatures of several fields of
HttpConfig
:httpConfigCheckResponse
,httpConfigRetryPolicy
, andhttpConfigRetryJudge
in order to eliminate redundantIO
and prevent the possibility that these functions could start consumingBodyReader
. -
Removed the
makeResponsePreview
method from theHttpResponse
type class. Preview business is handled by the library automatically on a lower level now. Users do not need to concern themselves with such stuff. -
Changed the type signature of the
getHttpResponse
method of theHttpResponse
type class. Previously it left too much freedom (and responsibility) to implementers of the method. In fact, we now limit whatgetHttpResponse
does to just consuming and interpretingResponse BodyReader
, so we can properly control details of connection opening/closing etc., for the user. -
Dropped support for GHC 7.8.
-
Minor documentation improvements.
-
Changed the signature of the
makeResponseBodyPreview
fromresponse -> IO ByteString
toresponse -> ByteString
. -
Minor documentation improvements.
- Added the
Req
monad andrunReq
function to run it. This allows to usereq
without defining new (orphan) instances.
- Added
basicAuthUnsafe
.
-
Made URL parsing functions
parseUrlHttp
andparseUrlHttps
recognize port numbers. -
Added
req'
function that allows to perform requests via a callback that receives pre-constructed request and manager. -
Removed the
ReturnRequest
HTTP response implementation as it was not quite safe and was not going to work with retrying. Usereq'
instead for “pure” testing. -
Changed the type of
httpConfigCheckResponse
, so the second argument can be any instance ofHttpResponse
. -
Added built-in automatic retrying. See
httpConfigRetryPolicy
andhttpConfigRetryJudge
inHttpConfig
. The default configuration retries 5 times on request timeouts. -
Added the
makeResponseBodyPreview
method to theHttpResponse
type class that allows to specify how to build a “preview” of response body for inclusion into exceptions. -
Improved wording in the documentation and
README.md
.
-
Added support for multipart form data in the form of
ReqBodyMultipart
body option andreqBodyMultipart
helper function. This also required a change in the type signature ofgetRequestContentType
, which now takesbody
, notProxy body
because we need to extract boundary frombody
and put it intoContent-Type
header. This change, however, shouldn't be too dangerous for end-users. -
Added support for OAuth 1.0 authentication via
oAuth1
option.
- Initial release.