func MatchResponse(rt *runtime.RoundTrip) (ResponseHandler, error) {
	if rt == nil {
		return nil, fmt.Errorf("empty roundtrip")
	}
	resp := rt.Response
	rm := &ResponseMatcher{
		code:    resp.StatusCode,
		headers: resp.Headers,
		defs:    rt.Definitions,
	}
	if resp.Body == nil {
		return rm, nil
	}
	if len(resp.Body) == 0 {
		rm.emptyBody = true
		return rm, nil
	}
	m, err := matcher.Parse(resp.Body)
	if err != nil {
		return nil, fmt.Errorf("parse json error: %v", err)
	}
	rm.bodyMatcher = m
	return rm, nil
}
MatchResponse returns a response matcher
package roundtrip
import (
	"encoding/json"
	"errors"
	"fmt"
	"io/ioutil"
	"net/http"
	"reflect"
	"strings"
	"github.com/caicloud/aloe/matcher"
	"github.com/caicloud/aloe/runtime"
	"github.com/caicloud/aloe/utils/close"
	"github.com/caicloud/aloe/utils/indent"
	"github.com/caicloud/aloe/utils/jsonutil"
	"github.com/onsi/gomega/format"
	gomegatypes "github.com/onsi/gomega/types"
)
type ResponseHandler interface {
	gomegatypes.GomegaMatcher
	Variables() map[string]jsonutil.Variable
}
type ResponseMatcher struct {
	bodyMatcher gomegatypes.GomegaMatcher
	emptyBody bool
	code int
	headers map[string]string
	defs []runtime.Definition
	parsed bool
	vars map[string]jsonutil.Variable
	failures []error
	lastFailures []error
}