haskell / haskell/wreq

Exposing internal modules?

Open
#153 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
381
Forks
72
PR merge metrics
No merged PRs in 30d

Description

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.

```haskell
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)?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.