func (r *Resolver) Resolve(tk string) (*token.Introspection, error) {
	resp, err := r.httpClient.PostForm(r.tokenIntrospectionURL,
		url.Values{tokenFormKey: {tk}})
	if err != nil {
		return nil, err
	}
	defer func() {
		err := resp.Body.Close()
		if err != nil {
			logger.Warnf("failed to close response body")
		}
	}()
	return getTokenInfo(resp)
}
Resolve returns token information based on token
package resolver
import (
	"crypto/tls"
	"encoding/json"
	"errors"
	"io/ioutil"
	"net/http"
	"net/url"
	"github.com/trustbloc/edge-core/pkg/log"
	"github.com/trustbloc/sandbox/pkg/token"
)
const tokenFormKey = "token"
var logger = log.New("sandbox-token-resolver")
type Option func(opts *Resolver)
func WithTLSConfig(tlsConfig *tls.Config) Option {
	return func(opts *Resolver) {
		opts.httpClient.Transport = &http.Transport{TLSClientConfig: tlsConfig}
	}
}
type Resolver struct {
	tokenIntrospectionURL string
	httpClient            *http.Client
}
func New(tokenIntrospectionURL string, opts ...Option) *Resolver {
	resolver := &Resolver{tokenIntrospectionURL: tokenIntrospectionURL, httpClient: &http.Client{}}
	for _, opt := range opts {
		opt(resolver)
	}
	return resolver
}