()
| 32 | } |
| 33 | |
| 34 | func (r response) contentType() string { |
| 35 | for name, value := range r.Headers { |
| 36 | if strings.EqualFold(name, "Content-Type") { |
| 37 | return value |
| 38 | } |
| 39 | } |
| 40 | if r.RawBody != nil { |
| 41 | return "application/octet-stream" |
| 42 | } |
| 43 | return "application/json; charset=utf-8" |
| 44 | } |
| 45 | |
| 46 | func (r response) status() int { |
| 47 | if r.Status == 0 { |