haskell / haskell/HTTP

getRequest returns Request_String instead of Request a

Open
#1 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haskell
Stars
186
Forks
59
PR merge metrics
No merged PRs in 30d

Description

What's the reason for not having `getRequest` and `postRequest` return `Request a`, i.e.:

```
getRequest :: BufferType a => String -> Request a
postRequest :: BufferType a => String -> Request a
```

If they were like this, it would be much easier to tell the library to use (Lazy) ByteStrings instead of Strings. The simplest way I could do that with what's in the library at this point is this:

```
request :: URI -> IO ByteString
request url = simpleHTTP (defaultGETRequest_ url) >>= getResponseBody
```

While it's not necessarily ugly or bad, I think it would be much nicer to have polymorphic `getRequest`/`postRequest` functions.

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.