func (m *MockHTTPTransport) SetResponsePayload(payload []byte) int {
	m.init()
	encodedMessage := base64.StdEncoding.EncodeToString(payload)
	reader := strings.NewReader(encodedMessage)
	m.responses = append(m.responses, &http.Response{
		Body:          ioutil.NopCloser(reader),
		ContentLength: int64(len(payload)),
		Status:        "200 OK",
		StatusCode:    200,
		Proto:         "HTTP/1.0",
		ProtoMajor:    1,
		ProtoMinor:    0,
	})
	m.errors = append(m.errors, nil)
	return len(m.responses) - 1
}
// SetResponsePayload registers a given payload in the transport.
// The payload will be encoded as Base64 and wrapped into a io.Reader. This also
// sets a status code of 200 and the error for the given call will be nil.
// The index of the response will be returned.
SetResponsePayload registers a given payload in the transport.
The payload will be encoded as Base64 and wrapped into a io.Reader. This also
sets a status code of 200 and the error for the given call will be nil.
The index of the response will be returned.
// SetResponsePayload registers a given payload in the transport . // The payload will be encoded as Base64 and wrapped into a io . Reader . This also // sets a status code of 200 and the error for the given call will be nil . // The index of the response will be returned .
func (m *MockHTTPTransport) SetResponsePayload(payload []byte) int {
	m.init()
	encodedMessage := base64.StdEncoding.EncodeToString(payload)
	reader := strings.NewReader(encodedMessage)
	m.responses = append(m.responses, &http.Response{
		Body:          ioutil.NopCloser(reader),
		ContentLength: int64(len(payload)),
		Status:        "200 OK",
		StatusCode:    200,
		Proto:         "HTTP/1.0",
		ProtoMajor:    1,
		ProtoMinor:    0,
	})
	m.errors = append(m.errors, nil)
	return len(m.responses) - 1
}
func ( m * MockHTTPTransport ) SetResponsePayload ( payload [ ] byte ) int { m . init ( ) encodedMessage := base64 . StdEncoding . EncodeToString ( payload ) reader := strings . NewReader ( encodedMessage ) m . responses = append ( m . responses , & http . Response { Body : ioutil . NopCloser ( reader ) , ContentLength : int64 ( len ( payload ) ) , Status : " " , StatusCode : 200 , Proto : " " , ProtoMajor : 1 , ProtoMinor : 0 , } ) m . errors = append ( m . errors , nil ) return len ( m . responses ) - 1 }
SetResponsePayload registers a given payload in the transport.
SetResponsePayload registers a given payload in the transport .