wreq icon indicating copy to clipboard operation
wreq copied to clipboard

Exposing internal modules?

Open saurabhnanda opened this issue 1 year ago • 0 comments

My app has the following exception type which is used to bail out from HTTP requests which returned something unexpected. There are many APIs in the wild that return a 200 ok with a weird custom data structure in the response that indicates an error. The following type covers all such situations because it allows the raw response AND the raw request to be logged for debugging.

data UnexpectedApiResponse = UnexpectedApiResponse String Request (Response BSL.ByteString)

HOWEVER, as a user of the wreq library the only way to get hold of the original Request is via the prepareGet and preparePost methods, which are inside hidden/internal modules.

Any thoughts on exposing these Internal modules (with a big fat warning, if required)?

saurabhnanda avatar Jan 22 '24 17:01 saurabhnanda