Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mock a Wreq Response

I want to manually create a Response in order to mock a web server, similar to this blog post. However, the Network.Wreq library that I'm using doesn't reveal the constructor for Response. How do I create a Response manually?

like image 744
terratinkah Avatar asked Mar 21 '26 11:03

terratinkah


1 Answers

Looking at 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.

like image 191
duplode Avatar answered Mar 23 '26 03:03

duplode