func (c *Fetch) TakeResponseBodyAsStream(requestId string) (string, error) {
	var v FetchTakeResponseBodyAsStreamParams
	v.RequestId = requestId
	return c.TakeResponseBodyAsStreamWithParams(&v)
}
TakeResponseBodyAsStream - Returns a handle to the stream representing the response body. The request must be paused in the HeadersReceived stage. Note that after this command the request can't be continued as is -- client either needs to cancel it or to provide the response body. The stream only supports sequential read, IO.read will fail if the position is specified. This method is mutually exclusive with getResponseBody. Calling other methods that affect the request or disabling fetch domain before body is received results in an undefined behavior.
requestId -
Returns -  stream -
package gcdapi
import (
	"encoding/json"
	"github.com/wirepair/gcd/gcdmessage"
)
type FetchRequestPattern struct {
	UrlPattern   string `json:"urlPattern,omitempty"`    
	ResourceType string `json:"resourceType,omitempty"`  
	RequestStage string `json:"requestStage,omitempty"`  
}
type FetchHeaderEntry struct {
	Name  string `json:"name"`   
	Value string `json:"value"`  
}
type FetchAuthChallenge struct {
	Source string `json:"source,omitempty"`  
	Origin string `json:"origin"`            
	Scheme string `json:"scheme"`            
	Realm  string `json:"realm"`             
}
type FetchAuthChallengeResponse struct {
	Response string `json:"response"`            
	Username string `json:"username,omitempty"`  
	Password string `json:"password,omitempty"`  
}
type FetchRequestPausedEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId           string              `json:"requestId"`                      
		Request             *NetworkRequest     `json:"request"`                        
		FrameId             string              `json:"frameId"`                        
		ResourceType        string              `json:"resourceType"`                   
		ResponseErrorReason string              `json:"responseErrorReason,omitempty"`  
		ResponseStatusCode  int                 `json:"responseStatusCode,omitempty"`   
		ResponseHeaders     []*FetchHeaderEntry `json:"responseHeaders,omitempty"`      
	} `json:"Params,omitempty"`
}
type FetchAuthRequiredEvent struct {
	Method string `json:"method"`
	Params struct {
		RequestId     string              `json:"requestId"`      
		Request       *NetworkRequest     `json:"request"`        
		FrameId       string              `json:"frameId"`        
		ResourceType  string              `json:"resourceType"`   
		AuthChallenge *FetchAuthChallenge `json:"authChallenge"`  
	} `json:"Params,omitempty"`
}
type Fetch struct {
	target gcdmessage.ChromeTargeter
}
func NewFetch(target gcdmessage.ChromeTargeter) *Fetch {
	c := &Fetch{target: target}
	return c
}
func (c *Fetch) Disable() (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Fetch.disable"})
}
type FetchEnableParams struct {
	Patterns []*FetchRequestPattern `json:"patterns,omitempty"`
	HandleAuthRequests bool `json:"handleAuthRequests,omitempty"`
}
func (c *Fetch) EnableWithParams(v *FetchEnableParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Fetch.enable", Params: v})
}
func (c *Fetch) Enable(patterns []*FetchRequestPattern, handleAuthRequests bool) (*gcdmessage.ChromeResponse, error) {
	var v FetchEnableParams
	v.Patterns = patterns
	v.HandleAuthRequests = handleAuthRequests
	return c.EnableWithParams(&v)
}
type FetchFailRequestParams struct {
	RequestId string `json:"requestId"`
	ErrorReason string `json:"errorReason"`
}
func (c *Fetch) FailRequestWithParams(v *FetchFailRequestParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Fetch.failRequest", Params: v})
}
func (c *Fetch) FailRequest(requestId string, errorReason string) (*gcdmessage.ChromeResponse, error) {
	var v FetchFailRequestParams
	v.RequestId = requestId
	v.ErrorReason = errorReason
	return c.FailRequestWithParams(&v)
}
type FetchFulfillRequestParams struct {
	RequestId string `json:"requestId"`
	ResponseCode int `json:"responseCode"`
	ResponseHeaders []*FetchHeaderEntry `json:"responseHeaders"`
	Body string `json:"body,omitempty"`
	ResponsePhrase string `json:"responsePhrase,omitempty"`
}
func (c *Fetch) FulfillRequestWithParams(v *FetchFulfillRequestParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Fetch.fulfillRequest", Params: v})
}
func (c *Fetch) FulfillRequest(requestId string, responseCode int, responseHeaders []*FetchHeaderEntry, body string, responsePhrase string) (*gcdmessage.ChromeResponse, error) {
	var v FetchFulfillRequestParams
	v.RequestId = requestId
	v.ResponseCode = responseCode
	v.ResponseHeaders = responseHeaders
	v.Body = body
	v.ResponsePhrase = responsePhrase
	return c.FulfillRequestWithParams(&v)
}
type FetchContinueRequestParams struct {
	RequestId string `json:"requestId"`
	Url string `json:"url,omitempty"`
	Method string `json:"method,omitempty"`
	PostData string `json:"postData,omitempty"`
	Headers []*FetchHeaderEntry `json:"headers,omitempty"`
}
func (c *Fetch) ContinueRequestWithParams(v *FetchContinueRequestParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Fetch.continueRequest", Params: v})
}
func (c *Fetch) ContinueRequest(requestId string, url string, method string, postData string, headers []*FetchHeaderEntry) (*gcdmessage.ChromeResponse, error) {
	var v FetchContinueRequestParams
	v.RequestId = requestId
	v.Url = url
	v.Method = method
	v.PostData = postData
	v.Headers = headers
	return c.ContinueRequestWithParams(&v)
}
type FetchContinueWithAuthParams struct {
	RequestId string `json:"requestId"`
	AuthChallengeResponse *FetchAuthChallengeResponse `json:"authChallengeResponse"`
}
func (c *Fetch) ContinueWithAuthWithParams(v *FetchContinueWithAuthParams) (*gcdmessage.ChromeResponse, error) {
	return gcdmessage.SendDefaultRequest(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Fetch.continueWithAuth", Params: v})
}
func (c *Fetch) ContinueWithAuth(requestId string, authChallengeResponse *FetchAuthChallengeResponse) (*gcdmessage.ChromeResponse, error) {
	var v FetchContinueWithAuthParams
	v.RequestId = requestId
	v.AuthChallengeResponse = authChallengeResponse
	return c.ContinueWithAuthWithParams(&v)
}
type FetchGetResponseBodyParams struct {
	RequestId string `json:"requestId"`
}
func (c *Fetch) GetResponseBodyWithParams(v *FetchGetResponseBodyParams) (string, bool, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Fetch.getResponseBody", Params: v})
	if err != nil {
		return "", false, err
	}
	var chromeData struct {
		Result struct {
			Body          string
			Base64Encoded bool
		}
	}
	if resp == nil {
		return "", false, &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return "", false, &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return "", false, err
	}
	return chromeData.Result.Body, chromeData.Result.Base64Encoded, nil
}
func (c *Fetch) GetResponseBody(requestId string) (string, bool, error) {
	var v FetchGetResponseBodyParams
	v.RequestId = requestId
	return c.GetResponseBodyWithParams(&v)
}
type FetchTakeResponseBodyAsStreamParams struct {
	RequestId string `json:"requestId"`
}
func (c *Fetch) TakeResponseBodyAsStreamWithParams(v *FetchTakeResponseBodyAsStreamParams) (string, error) {
	resp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: "Fetch.takeResponseBodyAsStream", Params: v})
	if err != nil {
		return "", err
	}
	var chromeData struct {
		Result struct {
			Stream string
		}
	}
	if resp == nil {
		return "", &gcdmessage.ChromeEmptyResponseErr{}
	}
	cerr := &gcdmessage.ChromeErrorResponse{}
	json.Unmarshal(resp.Data, cerr)
	if cerr != nil && cerr.Error != nil {
		return "", &gcdmessage.ChromeRequestErr{Resp: cerr}
	}
	if err := json.Unmarshal(resp.Data, &chromeData); err != nil {
		return "", err
	}
	return chromeData.Result.Stream, nil
}