1

How can I set the request body when using customMethod https://hackage.haskell.org/package/wreq-0.5.2.1/docs/Network-Wreq.html#v:customMethod?

post, put etc accept a parameter for the body, however there is no such parameter for customMethod.

Chris Stryczynski
  • 30,145
  • 48
  • 175
  • 286

1 Answers1

1

Use customPayloadMethod to specify a custom method on a request with a postable body.

customPayloadMethod :: Postable a => String -> String -> a -> IO (Response ByteString)

There are a few other variations of this depending on your needs:

customPayloadMethodWith :: Postable a => String -> Options -> String -> a -> IO (Response ByteString) Source#
customHistoriedPayloadMethod :: Postable a => String -> String -> a -> IO (HistoriedResponse ByteString) Source#
customHistoriedPayloadMethodWith :: Postable a => String -> Options -> String -> a -> IO (HistoriedResponse ByteString)
Chad Gilbert
  • 36,115
  • 4
  • 89
  • 97