func NewTestAPI(tb testing.TB, handler http.Handler) *TestAPI {
	return &TestAPI{
		t:       td.NewT(tb),
		handler: handler,
	}
}
NewTestAPI creates a TestAPI that can be used to test routes of the
API behind "handler".

tdhttp.NewTestAPI(t, mux).
Get("/test").
CmpStatus(200).
CmpBody("OK!")

Several routes can be tested with the same instance as in:

ta := tdhttp.NewTestAPI(t, mux)

ta.Get("/test").
CmpStatus(200).
CmpBody("OK!")

ta.Get("/ping").
CmpStatus(200).
CmpBody("pong")

Note that "tb" can be a *testing.T as well as a *td.T.
package tdhttp
import (
	"encoding/json"
	"encoding/xml"
	"fmt"
	"io"
	"net/http"
	"net/http/httptest"
	"net/url"
	"reflect"
	"runtime"
	"strings"
	"testing"
	"time"
	"github.com/maxatome/go-testdeep/helpers/tdhttp/internal"
	"github.com/maxatome/go-testdeep/helpers/tdutil"
	"github.com/maxatome/go-testdeep/internal/color"
	"github.com/maxatome/go-testdeep/internal/ctxerr"
	"github.com/maxatome/go-testdeep/internal/types"
	"github.com/maxatome/go-testdeep/td"
)
type TestAPI struct {
	t       *td.T
	handler http.Handler
	name    string
	sentAt        time.Time
	response      *httptest.ResponseRecorder
	statusFailed  bool
	headerFailed  bool
	cookiesFailed bool
	bodyFailed    bool
	autoDumpResponse bool
	responseDumped   bool
}