func (r *Response) IsError() bool {
	return r.StatusCode() > 399
}
IsError method returns true if HTTP status code >= 400 otherwise false.
package resty
import (
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"strings"
	"time"
)
type Response struct {
	Request     *Request
	RawResponse *http.Response
	body       []byte
	size       int64
	receivedAt time.Time
}
func (r *Response) Body() []byte {
	if r.RawResponse == nil {
		return []byte{}
	}
	return r.body
}
func (r *Response) Status() string {
	if r.RawResponse == nil {
		return ""
	}
	return r.RawResponse.Status
}
func (r *Response) StatusCode() int {
	if r.RawResponse == nil {
		return 0
	}
	return r.RawResponse.StatusCode
}
func (r *Response) Result() interface{} {
	return r.Request.Result
}
func (r *Response) Error() interface{} {
	return r.Request.Error
}
func (r *Response) Header() http.Header {
	if r.RawResponse == nil {
		return http.Header{}
	}
	return r.RawResponse.Header
}
func (r *Response) Cookies() []*http.Cookie {
	if r.RawResponse == nil {
		return make([]*http.Cookie, 0)
	}
	return r.RawResponse.Cookies()
}
func (r *Response) String() string {
	if r.body == nil {
		return ""
	}
	return strings.TrimSpace(string(r.body))
}
func (r *Response) Time() time.Duration {
	return r.receivedAt.Sub(r.Request.Time)
}
func (r *Response) ReceivedAt() time.Time {
	return r.receivedAt
}
func (r *Response) Size() int64 {
	return r.size
}
func (r *Response) RawBody() io.ReadCloser {
	if r.RawResponse == nil {
		return nil
	}
	return r.RawResponse.Body
}
func (r *Response) IsSuccess() bool {
	return r.StatusCode() > 199 && r.StatusCode() < 300
}