Skip to content

body of Request should be optional #2

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

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 4 additions & 4 deletions src/Network/HTTP/Types/Exchange.purs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ newtype Request = Request
, headers :: Headers
, cookies :: List Cookie
, auth :: Maybe Auth -- ^ If Auth information is provided in both the request.uri and request.auth, the auth in request.auth is preferred.
, body :: String
, body :: Maybe String
, timeout :: Maybe Milliseconds
}

Expand Down Expand Up @@ -160,7 +160,7 @@ defRequest ::
, headers :: Headers
, cookies :: List Cookie
, auth :: Maybe Auth
, body :: String
, body :: Maybe String
, timeout :: Maybe Milliseconds
}
defRequest =
Expand All @@ -169,7 +169,7 @@ defRequest =
, headers: mempty
, cookies: mempty
, auth : Nothing
, body : ""
, body : Nothing
, timeout: Nothing
}

Expand Down Expand Up @@ -258,7 +258,7 @@ setAuth :: Auth -> Request -> Request
setAuth auth (Request r) = Request r { auth = Just auth }

setBody :: String -> Request -> Request
setBody body (Request r) = Request r { body = body }
setBody body (Request r) = Request r { body = Just body }

setTimeout :: Milliseconds -> Request -> Request
setTimeout timeout (Request r) = Request r { timeout = Just timeout }
Expand Down