func (h *Retrieve) retrieve(rw http.ResponseWriter, req *http.Request) {
	hash := getHash(req)
	maxSize := getMaxSize(req)
	logger.Debugf("[%s:%s:%s] Retrieving resp for hash [%s] with max-size %d", h.channelID, h.ChaincodeName, h.Collection, hash, maxSize)
	rrw := newRetrieveWriter(rw)
	content, err := h.doRetrieve(hash, maxSize)
	if err != nil {
		rrw.WriteError(err)
		return
	}
	logger.Debugf("[%s:%s:%s] ... retrieved content for hash [%s]: Content: %s", h.channelID, h.ChaincodeName, h.Collection, hash, content)
	rrw.Write(content)
}
version retrieves the content from the DCAS store by hash
package dcashandler
import (
	"bytes"
	"fmt"
	"net/http"
	"strconv"
	"strings"
	"github.com/gorilla/mux"
	"github.com/hyperledger/fabric/common/flogging"
	dcas "github.com/trustbloc/fabric-peer-ext/pkg/collections/offledger/dcas/client"
	"github.com/trustbloc/sidetree-core-go/pkg/restapi/common"
	"github.com/trustbloc/sidetree-fabric/pkg/httpserver"
)
var logger = flogging.MustGetLogger("sidetree_peer")
const (
	hashParam    = "hash"
	maxSizeParam = "max-size"
	encodingErrMsg = "selected encoding not supported"
)
type Retrieve struct {
	Config
	path         string
	channelID    string
	dcasProvider dcasClientProvider
}
type dcasClientProvider interface {
	GetDCASClient(channelID, namespace, coll string) (dcas.DCAS, error)
}
func NewRetrieveHandler(channelID string, cfg Config, dcasProvider dcasClientProvider) *Retrieve {
	return &Retrieve{
		Config:       cfg,
		path:         fmt.Sprintf("%s/{%s}", cfg.BasePath, hashParam),
		dcasProvider: dcasProvider,
		channelID:    channelID,
	}
}
func (h *Retrieve) Path() string {
	return h.path
}
func (h *Retrieve) Method() string {
	return http.MethodGet
}
func (h *Retrieve) Handler() common.HTTPRequestHandler {
	return h.retrieve
}