|
|
@ -303,16 +303,6 @@ type Response struct {
|
|
303
|
303
|
RandomDelay time.Duration `yaml:"randomDelay"`
|
|
304
|
304
|
}
|
|
305
|
305
|
|
|
306
|
|
func (resp Response) String() string {
|
|
307
|
|
buf := new(bytes.Buffer)
|
|
308
|
|
fmt.Fprintf(buf, "%s %s\r\n", resp.Method, resp.Path)
|
|
309
|
|
for _, header := range resp.Headers {
|
|
310
|
|
fmt.Fprintf(buf, "%s: %s\r\n", header.Name, header.Value)
|
|
311
|
|
}
|
|
312
|
|
fmt.Fprintf(buf, "\r\n%s", resp.Body)
|
|
313
|
|
return buf.String()
|
|
314
|
|
}
|
|
315
|
|
|
|
316
|
306
|
// AsHTTP returns a http.Response representation.
|
|
317
|
307
|
func (resp Response) AsHTTP() *http.Response {
|
|
318
|
308
|
headers := make(map[string][]string)
|