@@ -17,8 +17,8 @@ public section
1717/-!
1818# Response
1919
20- This module provides the `Response` type, which representation a HTTP request . It also defines ways
21- to build a `Request` using functiosn that make it easier .
20+ This module provides the `Response` type, which represents an HTTP response . It also defines
21+ builder functions and convenience methods for constructing responses with various content types .
2222-/
2323
2424namespace Std.Http
@@ -55,12 +55,12 @@ HTTP response structure parameterized by body type
5555-/
5656structure Response (t : Type ) where
5757 /--
58- The information of the status-line of the request.
58+ The information of the status-line of the response
5959 -/
6060 head : Response.Head := {}
6161
6262 /--
63- The content of the request .
63+ The content of the response .
6464 -/
6565 body : t
6666deriving Inhabited
@@ -70,7 +70,7 @@ Builds a HTTP Response.
7070-/
7171structure Response.Builder where
7272 /--
73- The information of the status-line of the request.
73+ The information of the status-line of the response
7474 -/
7575 head : Head := {}
7676
@@ -108,7 +108,7 @@ def version (builder : Builder) (version : Version) : Builder :=
108108 { builder with head := { builder.head with version := version } }
109109
110110/--
111- Adds a single header to the response being built
111+ Sets the headers for the response being built
112112-/
113113def headers (builder : Builder) (headers : Headers) : Builder :=
114114 { builder with head := { builder.head with headers } }
@@ -174,15 +174,15 @@ def html (builder : Builder) (body : String) : Response Body :=
174174end Builder
175175
176176/--
177- Creates a new HTTP Response with OK status and the provided string body
177+ Creates a new HTTP Response with OK status and the provided body
178178-/
179179def ok (body : t) (headers : Headers := Headers.empty) : Response t :=
180180 new
181181 |>.headers headers
182182 |>.body body
183183
184184/--
185- Creates a new HTTP Response with the specified status and string body
185+ Creates a new HTTP Response with the specified status and body
186186-/
187187def buildWithStatus (status : Status) (body : t) : Response t :=
188188 new
0 commit comments