Skip to content

Commit

Permalink
update requests doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yinheli committed Jul 15, 2021
1 parent 53c6a32 commit c6d159f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions pkg/requests/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (
)

const (
ContentTypeJSON = "application/json; charset=utf-8"
ContentTypeForm = "application/x-www-form-urlencoded; charset=utf-8"
ContentTypeText = "text/plain; charset=utf-8"
ContentTypeJSON = "application/json; charset=utf-8" // content type json
ContentTypeForm = "application/x-www-form-urlencoded; charset=utf-8" // context type form
ContentTypeText = "text/plain; charset=utf-8" // content type text

HeaderXRequestID = "X-Request-ID"
HeaderXRequestID = "X-Request-ID" // header field for request id
)

var (
Expand Down Expand Up @@ -259,10 +259,12 @@ func (t *requests) Do() *Response {
}
}

// Err get error
func (t *Response) Err() error {
return t.err
}

// Dump dump request & response
func (t *Response) Dump(body bool) map[string]interface{} {
dump := make(map[string]interface{})
dump["escape"] = t.escape.Milliseconds()
Expand Down

0 comments on commit c6d159f

Please sign in to comment.