Skip to content

Commit 8521031

Browse files
committed
v1.4.0
1 parent 9a5c2b0 commit 8521031

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

CHANGELOG.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Changelog
22

3-
## v1.3.1 - TBC
3+
## v1.4.0 - 2020-09-09
44

5-
- The `gleam/http.default_req` function returns a `Request(BitString)` instead
6-
`Request(String)`
5+
- The `http.response` function returns a `Response(String)` instead
6+
`Response(Nil)`
77

88
## v1.3.0 - 2020-08-04
99

src/gleam/http.gleam

+4-7
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,8 @@ pub fn req_from_uri(uri: Uri) -> Result(Request(String), Nil) {
183183

184184
/// Construct an empty Response.
185185
///
186-
/// The body type of the returned response is `Nil`, and should be set with a
187-
/// call to `set_resp_body`.
188-
///
189-
pub fn response(status: Int) -> Response(Nil) {
190-
Response(status: status, headers: [], body: Nil)
186+
pub fn response(status: Int) -> Response(String) {
187+
Response(status: status, headers: [], body: "")
191188
}
192189

193190
/// Return the non-empty segments of a request path.
@@ -361,11 +358,11 @@ pub fn redirect(uri: String) -> Response(String) {
361358
/// A request with commonly used default values. This request can be used as
362359
/// an initial value and then update to create the desired request.
363360
///
364-
pub fn default_req() -> Request(BitString) {
361+
pub fn default_req() -> Request(String) {
365362
Request(
366363
method: Get,
367364
headers: [],
368-
body: <<>>,
365+
body: "",
369366
scheme: Https,
370367
host: "localhost",
371368
port: option.None,

src/gleam_http.app.src

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{application, gleam_http,
22
[{description, "Types and functions for HTTP clients and servers!"},
3-
{vsn, "1.3.0"},
3+
{vsn, "1.4.0"},
44
{registered, []},
55
{applications,
66
[kernel,

test/gleam/http_test.gleam

+1-1
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ pub fn default_request_test() {
898898
|> should.equal(http.Request(
899899
method: http.Get,
900900
headers: [],
901-
body: <<>>,
901+
body: "",
902902
scheme: http.Https,
903903
host: "localhost",
904904
port: None,

0 commit comments

Comments
 (0)