Process request details.

        0: CURLINFO_TEXT
        1: CURLINFO_HEADER_IN
        2: CURLINFO_HEADER_OUT
        3: CURLINFO_DATA_IN
        4: CURLINFO_DATA_OUT
        5: CURLINFO_unrecognized_type
964751
def debug_processor(self, _type, text):
        
        if _type == pycurl.INFOTYPE_HEADER_OUT:
            if isinstance(text, six.text_type):
                text = text.encode('utf-8')
            self.request_head += text

        if _type == pycurl.INFOTYPE_DATA_OUT:
            # Untill 7.19.5.2 version
            # pycurl gives unicode in `text` variable
            # WTF??? Probably that codes would fails
            # or does unexpected things if you use
            # pycurl<7.19.5.2
            if isinstance(text, six.text_type):
                text = text.encode('utf-8')
            self.request_body += text

        #if _type == pycurl.INFOTYPE_TEXT:
        #    if self.request_log is None:
        #        self.request_log = ''
        #    self.request_log += text

        if self.verbose_logging:
            if _type in (pycurl.INFOTYPE_TEXT, pycurl.INFOTYPE_HEADER_IN,
                         pycurl.INFOTYPE_HEADER_OUT):
                marker_types = {
                    pycurl.INFOTYPE_TEXT: 'i',
                    pycurl.INFOTYPE_HEADER_IN: '<',
                    pycurl.INFOTYPE_HEADER_OUT: '>',
                }
                marker = marker_types[_type]
                logger.debug('%s: %s', marker, text.rstrip())
354395
def read_detail(self, request):
        
        pipeline = crud_pipeline_factory.read_detail_pipeline(
            configuration=self.configuration)
        return pipeline(request=request)
725154
def handle_request(self, request_text=None):
        

        if request_text is None and \
            os.environ.get('REQUEST_METHOD', None) == 'GET':
            self.handle_get()
        else:
            # POST data is normally available through stdin
            if request_text is None:
                request_text = sys.stdin.read()

            self.handle_xmlrpc(request_text)
562628
def info(self):
        """"""
        url = self.api_url + self.info_url
        resp = self.session.get(url)
        if resp.status_code != 200:
            error = {'description': "Info HTTP response not valid"}
            raise CFException(error, resp.status_code)
        try:
            info = resp.json()
        except ValueError as e:
            error = {'description': "Info HTTP response not valid, %s" % str(e)}
            raise CFException(error, resp.status_code)
        return info
548671
function processHeader($lastLine = "\r\n") {
      $headers = array();
      $finished = false;

      while ( (!$finished) && (!feof($this->socket)) ) {
        $str = fgets($this->socket, 1024);
        $finished = ($str == $lastLine);
        if (!$finished) {
          list($hdr, $value) = preg_split('/: /', $str, 2);
// nasty workaround broken multiple same headers (eg. Set-Cookie headers) @FIXME
          if (isset($headers[$hdr])) {
            $headers[$hdr] .= '; ' . trim($value);
          } else {
            $headers[$hdr] = trim($value);
          }
        }
      }

      return $headers;
    }
95139
def process_header(self, header):
        
        metadata = {}
        for line in header.split("\n"):
            line = line.strip()
            for tag in self.header_tags:
                tag_text = "{}:".format(tag)
                if line.lower().startswith(tag_text):
                    metadata[tag] = line[len(tag_text) + 1 :].strip()

        return metadata
1169680
def _assemble_and_send_request(self):
        

        # Fire off the query.
        return self.client.service.getPickupAvailability(
            WebAuthenticationDetail=self.WebAuthenticationDetail,
            ClientDetail=self.ClientDetail,
            TransactionDetail=self.TransactionDetail,
            Version=self.VersionId,
            PickupType=self.PickupType,
            AccountNumber=self.AccountNumber,
            PickupAddress=self.PickupAddress,
            PickupRequestType=self.PickupRequestType,
            DispatchDate=self.DispatchDate,
            NumberOfBusinessDays=self.NumberOfBusinessDays,
            PackageReadyTime=self.PackageReadyTime,
            CustomerCloseTime=self.CustomerCloseTime,
            Carriers=self.Carriers,
            ShipmentAttributes=self.ShipmentAttributes,
            PackageDetails=self.PackageDetails
        )
1119108
protected function headerLine(/** @noinspection PhpUnusedParameterInspection */$curl, $header_line){
		$header = explode(':', $header_line, 2);

		if(count($header) === 2){
			$this->response_headers->{trim(strtolower($header[0]))} = trim($header[1]);
		}
		elseif(substr($header_line, 0, 4) === 'HTTP'){
			$status = explode(' ', $header_line, 3);

			$this->response_headers->httpversion = explode('/', $status[0], 2)[1];
			$this->response_headers->statuscode  = intval($status[1]);
			$this->response_headers->statustext  = trim($status[2]);
		}

		return strlen($header_line);
	}
724375
def handle_get_scanner_details(self):
        
        desc_xml = Element('description')
        desc_xml.text = self.get_scanner_description()
        details = [
            desc_xml,
            self.get_scanner_params_xml()
        ]
        return simple_response_str('get_scanner_details', 200, 'OK', details)
144413
function _convertDetails(type, details) {
  var convertedDetails = {}
  for (var data in details) {
    const string = type + '[' + data + ']';
    convertedDetails[string] = details[data];
  }
  return convertedDetails;
}
1235923
private function processRequest()
        {
            $this->request['resource'] = (isset($_GET['RESTurl']) && !empty($_GET['RESTurl'])) ? $_GET['RESTurl'] : 'index';
            unset($_GET['RESTurl']);
            $this->request['method'] = Inflector::lower($_SERVER['REQUEST_METHOD']);
            $this->request['headers'] = $this->getHeaders();
            $this->request['format'] = isset($_GET['format']) ? trim($_GET['format']) : null;
            switch($this->request['method']) {
                case 'get':
                    $this->request['params'] = $_GET;
                    break;
                case 'post':
                    $this->request['params'] = array_merge($_POST, $_GET);
                    break;
                case 'put':
                    parse_str(fgc('php://input'), $this->request['params']);
                    break;
                case 'delete':
                    $this->request['params'] = $_GET;
                    break;
                default:
                    break;
            }
            $this->request['content-type'] = $this->getResponseFormat($this->request['format']);
            if(!function_exists('trim_value')) {
                function trim_value(&$value)
                {
                    $value = trim($value);
                }
            }
            array_walk_recursive($this->request, 'trim_value');
        }
644080
def process_request(self, req):
        '''  '''
        # Check status code of request
        req.raise_for_status() # if codes not in 200s; error raise
        # Proper status code, but check if server returned a warning
        try:
            output = req.json()
        except:
            exit(req.text) # server returned html error
        # Try to find an error msg in the server response
        try:
            error = output['data'].get('errormsg')
        except:
            error = output.get('errormsg') # server has 2 variations of errormsg
        finally:
            if error:
                exit(error)
            return output
1170483
def process_details():
        
        results = {"argv": sys.argv, "working.directory": os.getcwd()}

        # Process ID and execution IDs (UID, GID, Login, ...)
        for key, method in {
            "pid": "getpid",
            "ppid": "getppid",
            "login": "getlogin",
            "uid": "getuid",
            "euid": "geteuid",
            "gid": "getgid",
            "egid": "getegid",
            "groups": "getgroups",
        }.items():
            try:
                results[key] = getattr(os, method)()
            except (AttributeError, OSError):
                results[key] = None
        return results
310788
private function initializeRequest()
    {
        $this->responseBody = '';
        $this->responseHeaders = array();
        $this->lastError = false;
        $this->addHeader('Accept', $this->getContentType());

        curl_setopt($this->curl, CURLOPT_POST, false);
        curl_setopt($this->curl, CURLOPT_PUT, false);
        curl_setopt($this->curl, CURLOPT_HTTPGET, false);

        curl_setopt($this->curl, CURLOPT_HTTPHEADER, $this->headers);
    }
1216062
async def parse(self, request):
        
        if request.content_type in {'application/x-www-form-urlencoded', 'multipart/form-data'}:
            return await request.post()

        if request.content_type == 'application/json':
            return await request.json()

        return await request.text()
1245400
def process_request(self, request_info=None, **kwargs):
        

        if isinstance(request_info, AuthorizationErrorResponse):
            return request_info

        _cid = request_info["client_id"]
        cinfo = self.endpoint_context.cdb[_cid]
        try:
            cookie = kwargs['cookie']
        except KeyError:
            cookie = ''
        else:
            del kwargs['cookie']

        if proposed_user(request_info):
            kwargs['req_user'] = proposed_user(request_info)
        else:
            try:
                _login_hint = request_info['login_hint']
            except KeyError:
                pass
            else:
                if self.endpoint_context.login_hint_lookup:
                    kwargs['req_user'] = self.endpoint_context.login_hint_lookup[
                        _login_hint]

        info = self.setup_auth(request_info, request_info["redirect_uri"],
                               cinfo, cookie, **kwargs)

        if 'error' in info:
            return info

        try:
            _function = info['function']
        except KeyError:  # already authenticated
            logger.debug("- authenticated -")
            logger.debug("AREQ keys: %s" % request_info.keys())

            res = self.authz_part2(info['user'], info['authn_event'],
                                   request_info, cookie=cookie)

            return res
        else:
            try:
                # Run the authentication function
                return {
                    'http_response': _function(**info['args']),
                    'return_uri': request_info["redirect_uri"]
                }
            except Exception as err:
                logger.exception(err)
                return {'http_response': 'Internal error: {}'.format(err)}
462816
protected function _gatherRequestInfo()
    {
        $this->_loadRequestMethod();
        $this->_loadRequestCookies();
        $this->_loadRequestUserAgent();
        $this->_loadRequestAuthorizationHeader();
        $this->_loadRequestAcceptHeader();
        $this->_loadRawHeaders();
        $this->_loadContentType();
        $this->_loadUrl();

        if($this->_requestMethod === 'POST'
            || $this->_requestMethod === 'PUT')
        {
            $this->_loadRequestBody();
        }
    }