From 7ed6961a0e0ef713c136a9d36f86bc7e31414dc5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 20 Aug 2016 17:59:14 -0400 Subject: http client, and --server --- HTTP.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'HTTP.hs') diff --git a/HTTP.hs b/HTTP.hs index ac4eeab..13a7bda 100644 --- a/HTTP.hs +++ b/HTTP.hs @@ -66,9 +66,15 @@ instance FromJSON ProofOfWorkRequirement instance FromHttpApiData ProofOfWork where parseUrlPiece = Right . ProofOfWork +instance ToHttpApiData ProofOfWork where + toUrlPiece (ProofOfWork t) = t + instance FromHttpApiData StorableObjectIdent where parseUrlPiece = Right . StorableObjectIdent . T.encodeUtf8 +instance ToHttpApiData StorableObjectIdent where + toUrlPiece (StorableObjectIdent b) = T.decodeUtf8 b + instance MimeRender OctetStream StorableObject where mimeRender _ = L.fromStrict . toByteString -- cgit v1.2.3