generate the response
333799
public String generateResponse() {
	 if (userName == null) {
            System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(): "+
            "ERROR: no userName parameter");
            return null;
         }
	 if (realm == null) {
            System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(): "+
            "ERROR: no realm parameter");
            return  null; 
         }
               
         System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(): "+
         "Trying to generate a response for the user: "+userName+" , with "+
         "the realm: "+ realm);
                
	 if (password == null)  {
            System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(): "+
            "ERROR: no password parameter");
		return null;
         }
         if (method == null)  {
            System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(): "+
            "ERROR: no method parameter");
		return null;
         }     
         if (uri== null)  {
            System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(): "+
            "ERROR: no uri parameter");
		return null;
         }     
         if (nonce== null)  {
            System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(): "+
            "ERROR: no nonce parameter");
		return null;
         }    
         if (messageDigest== null)  {
            System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(): "+
            "ERROR: the algorithm is not set");
		return null;
         }   
	
         
         /*******    GENERATE RESPONSE      ************************************/
         System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(), userName:"+userName+"!");
         System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(), realm:"+realm+"!");
         System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(), password:"+password+"!");
         System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(), uri:"+uri+"!");
         System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(), nonce:"+nonce+"!");
         System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(), method:"+method+"!");
         // A1
         String A1 = userName + ":" + realm+ ":" +   password ;
         byte mdbytes[] = messageDigest.digest(A1.getBytes());
         String HA1 = toHexString(mdbytes);
         System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(), HA1:"+HA1+"!");
         //A2
         String A2 = method.toUpperCase() + ":" + uri ;
         mdbytes = messageDigest.digest(A2.getBytes());
         String HA2 = toHexString(mdbytes);
         System.out.println("DEBUG, DigestClientAuthenticationMethod, generateResponse(), HA2:"+HA2+"!");
         //KD
         String KD = HA1 + ":" + nonce;
         if (cnonce != null) {
             if(cnonce.length()>0) KD += ":" + cnonce;
         }
         KD += ":" + HA2;
         mdbytes = messageDigest.digest(KD.getBytes());
         String response = toHexString(mdbytes);
        
         System.out.println("DEBUG, DigestClientAlgorithm, generateResponse():"+
         " response generated: "+response);
         
         return response;
    }
207068
private function generateResponse($view, $contentDisposition, $parameters,
        $options)
    {
        return new Response(
            $this->getOutputFromView($view, $parameters, $options),
            200,
            array(
                'Content-Type'          => 'application/pdf',
                'Content-Disposition'   => $contentDisposition,
            )
        );
    }
474826
def process_response(self, request, response, resource, req_succeeded):
        """"""
        sid = request.cookies.get(self.cookie_name, None)
        if sid is None or not self.store.exists(sid):
            sid = self.generate_sid()

        self.store.set(sid, request.context.get(self.context_name, {}))
        response.set_cookie(self.cookie_name, sid, expires=self.cookie_expires, max_age=self.cookie_max_age,
                            domain=self.cookie_domain, path=self.cookie_path, secure=self.cookie_secure,
                            http_only=self.cookie_http_only)
177522
private function generateResponse($request)
    {
        $context  = stream_context_create(
            array(
                'http' => array(
                    'method'  => "POST",
                    'header'  => "Content-Type: text/xml",
                    'content' => $request
                )
            )
        );
        $file     = file_get_contents(self::SEARCH_URL, false, $context);
        $response = xmlrpc_decode($file);

        return $response;
    }
612470
protected function _buildAndExecuteProxyResponse()
    {
        if($this->_responseModifier)
        {
          $data = call_user_func_array($this->_responseModifier, array(&$this->_responseBody, &$this->_responseHeaders));
        }

        $this->_generateProxyResponseHeaders();

        $this->_output($this->_responseBody);
    }
1242731
def _build_response(self, resp):
        """"""
        # rememberLogin
        # if self.method is 'LOGIN' and resp.json().get('code') == 200:
        #     cookiesJar.save_cookies(resp, NCloudBot.username)
        self.response.content = resp.content
        self.response.status_code = resp.status_code
        self.response.headers = resp.headers
365877
public function createResponse()
    {
        $response = $this->format();
        $response->headers->set('content-type', $this->getContentType());
        $response->setStatusCode($this->getStatusCode());
        $response->setCharset('UTF-8');

        return $response;
    }
38076
function displayResponse(response){
  
  // Gather and display HTTP response data
  var lines = [
    response.statusCode + ' ' + response.statusText,
    headersToString(response.headers)
  ];
  if(response.data){
    lines.push('');
    lines.push(prettyPrint(response.data));
  }
  output(lines.join('\n'));
  
  // Attach listeners to links so that clicking a link will auto-populate
  // the url field
  Array.from($output.querySelectorAll('.link')).forEach(function(link){
    link.addEventListener('click', function(){
      // Remove leading and trailing "
      $url.value = link.innerHTML.slice(1,-1);
      window.scrollTo(0, 0);
    });
  });
}
57070
function generateOptionsResponder(res, methods) {
  return function onDone(fn, err) {
    if (err || methods.length === 0) {
      return fn(err)
    }

    trySendOptionsResponse(res, methods, fn)
  }
}
410510
def create_response response
      json = JSON.parse(response.body_str)
      if json.is_a?(Array)
        result = json.map {|result| Fulfil::Base.new(result)}
      else
        result = Fulfil::Base.new(json)
        if result.type == "UserError"
          raise Fulfil::UserError, result.message
        end
      end
      result
    end
444429
def make_response(message, status_code, details=None):
    """"""
    response_body = dict(message=message)
    if details:
        response_body['details'] = details
    response = jsonify(response_body)
    response.status_code = status_code
    return response
1183929
def get_response(self):
        
        res = IODWriteMultipleRes()
        for field in ["seqNum", "ARUUID", "API", "slotNumber",
                      "subslotNumber", "index"]:
            res.setfieldval(field, self.getfieldval(field))

        # append all block response
        res_blocks = []
        for block in self.getfieldval("blocks"):
            res_blocks.append(block.get_response())
        res.setfieldval("blocks", res_blocks)
        return res
652328
public function generateAction()
    {
        $extension  = $this->params()->fromRoute('extension', QrCodeServiceInterface::DEFAULT_EXTENSION);
        $content    = $this->qrCodeService->getQrCodeContent($this->params());
        return $this->createResponse($content, $this->qrCodeService->generateContentType($extension));
    }
1147817
def success_response(field=None, data=None, request_type=""):
    """"""
    data_out = {}
    data_out["status"] = "success"
    if field:
        data_out[field] = data
    print("{} request successful.".format(request_type))
    js = dumps(data_out, default=date_handler)
    return Response(js, status=200, mimetype='application/json')
1373438
def create_response(request, body=None, status=None, headers=None):
    # type: (BaseHttpRequest, Any, HTTPStatus, dict) -> HttpResponse
    
    if body is None:
        return HttpResponse(None, status or HTTPStatus.NO_CONTENT, headers)
    else:
        body = request.response_codec.dumps(body)
        response = HttpResponse(body, status or HTTPStatus.OK, headers)
        response.set_content_type(request.response_codec.CONTENT_TYPE)
        return response
423600
def hook_response(self, response):
        " "
        # Decode content with json.
        response._content = json.loads(response.content)
        return response
1088083
def csv_response(self):
        """"""
        def stream():
            """Create data stream generator"""
            stream_file = io.StringIO()
            csvwriter = csv.writer(stream_file, delimiter=',', quotechar='"')

            csvwriter.writerow(self.get_current_fields())

            for index, item in enumerate(self.items()):
                csvwriter.writerow([value for index, value in item.items()])
                stream_file.seek(0)
                data = stream_file.read()
                stream_file.seek(0)
                stream_file.truncate()
                yield data

        response = StreamingHttpResponse(stream(), content_type="text/csv")
        response["Content-Disposition"] = "attachment; filename={}.csv".format(self.get_model_config().model_name.lower())
        return response