模拟一个 Wreq 响应
Mock a Wreq Response
我想手动创建一个 Response
以模拟 Web 服务器,类似于 this 博客 post。但是,我使用的 Network.Wreq
库没有显示 Response
的构造函数。如何手动创建 Response
?
正在查看 the sources of wreq reveals that the Response
type comes from the http-client library. That is the same library used by the blog post you link to, and so the solution is the same that, presumably, was used in the post: import Network.HTTP.Client.Internal
, which exports the constructor。
我想手动创建一个 Response
以模拟 Web 服务器,类似于 this 博客 post。但是,我使用的 Network.Wreq
库没有显示 Response
的构造函数。如何手动创建 Response
?
正在查看 the sources of wreq reveals that the Response
type comes from the http-client library. That is the same library used by the blog post you link to, and so the solution is the same that, presumably, was used in the post: import Network.HTTP.Client.Internal
, which exports the constructor。