如何使用 Wreq 设置 HTTP 请求主体?
How do I set the HTTP request body with Wreq?
使用customMethod
https://hackage.haskell.org/package/wreq-0.5.2.1/docs/Network-Wreq.html#v:customMethod时如何设置请求正文?
post
、put
等接受正文参数,但是 customMethod
.
没有这样的参数
使用 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)
使用customMethod
https://hackage.haskell.org/package/wreq-0.5.2.1/docs/Network-Wreq.html#v:customMethod时如何设置请求正文?
post
、put
等接受正文参数,但是 customMethod
.
使用 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)