@@ -29,21 +29,19 @@ type Response struct {
2929
3030// Body method returns HTTP response as []byte array for the executed request.
3131//
32- // Note: ` Response.Body` might be nil, if ` Request.SetOutput` is used.
32+ // NOTE: [ Response.Body] might be nil, if [ Request.SetOutput] is used.
3333func (r * Response ) Body () []byte {
3434 if r .RawResponse == nil {
3535 return []byte {}
3636 }
3737 return r .body
3838}
3939
40- // SetBody method is to set Response body in byte slice. Typically,
40+ // SetBody method is to set [ Response] body in byte slice. Typically,
4141// its helpful for test cases.
4242//
4343// resp.SetBody([]byte("This is test body content"))
4444// resp.SetBody(nil)
45- //
46- // Since v2.10.0
4745func (r * Response ) SetBody (b []byte ) * Response {
4846 r .body = b
4947 return r
@@ -113,7 +111,7 @@ func (r *Response) String() string {
113111
114112// Time method returns the time of HTTP response time that from request we sent and received a request.
115113//
116- // See ` Response.ReceivedAt` to know when client received response and see `Response.Request.Time` to know
114+ // See [ Response.ReceivedAt] to know when client received response and see `Response.Request.Time` to know
117115// when client sent a request.
118116func (r * Response ) Time () time.Duration {
119117 if r .Request .clientTrace != nil {
@@ -134,7 +132,8 @@ func (r *Response) Size() int64 {
134132 return r .size
135133}
136134
137- // RawBody method exposes the HTTP raw response body. Use this method in-conjunction with `SetDoNotParseResponse`
135+ // RawBody method exposes the HTTP raw response body. Use this method in-conjunction with
136+ // [Client.SetDoNotParseResponse] or [Request.SetDoNotParseResponse]
138137// option otherwise you get an error as `read err: http: read on closed response body`.
139138//
140139// Do not forget to close the body, otherwise you might get into connection leaks, no connection reuse.
@@ -156,10 +155,6 @@ func (r *Response) IsError() bool {
156155 return r .StatusCode () > 399
157156}
158157
159- //‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
160- // Response Unexported methods
161- //_______________________________________________________________________
162-
163158func (r * Response ) setReceivedAt () {
164159 r .receivedAt = time .Now ()
165160 if r .Request .clientTrace != nil {
0 commit comments