如何在使用customMethod
https://hackage.haskell.org/package/wreq-0.5.2.1/docs/Network-Wreq.html#v:customMethod时设置请求正文?
post
,put
等接受正文的参数,但customMethod
没有此参数。
答案 0 :(得分:1)
使用customPayloadMethod
为具有可预订正文的请求指定自定义方法。
customPayloadMethod :: Postable a => String -> String -> a -> IO (Response ByteString)
根据您的需要,还有其他一些变体:
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)