func (self *Surfer) Download(cReq *context.Request) *context.Response { cResp := context.NewResponse(nil) var resp *http.Response var err error if cReq.GetUsePhantomJS() { resp, err = self.phantom.Download(cReq) } else { resp, err = self.surf.Download(cReq) } cResp.SetRequest(cReq) cResp.SetResponse(resp) cResp.SetError(err) return cResp }