Documentation ¶
Index ¶
Constants ¶
View Source
const ( HeaderContentType = "Content-Type" ContentTypeAppJSON = "application/json" ContentTypeAppJSONUtf8 = "application/json; charset=utf-8" )
Variables ¶
This section is empty.
Functions ¶
func DoJSONSimple ¶
func JoinAbsolute ¶
JoinAbsolute performs a path.Join() while preserving two slashes after the scheme.
Types ¶
type ResponseInfo ¶
type ResponseInfo struct { Name string `json:"name,omitempty"` // to distinguish from other requests Method string `json:"method,omitempty"` URL string `json:"url,omitempty"` StatusCode int `json:"statusCode,omitempty"` Time time.Time `json:"time,omitempty"` Headers map[string]string `json:"headers,omitempty"` Body string `json:"body,omitempty"` }
ResponseInfo is a generic struct to handle response info.
func (*ResponseInfo) ToJSON ¶
func (resIn *ResponseInfo) ToJSON() []byte
ToJSON returns ResponseInfo as a JSON byte array, embedding json.Marshal errors if encountered.
Click to show internal directories.
Click to hide internal directories.