Attempt to solve the request.
18013
def solve(self):
        
        if self.solve_begun:
            raise ResolveError("cannot run solve() on a solve that has "
                               "already been started")

        t1 = time.time()
        pt1 = package_repo_stats.package_load_time

        # iteratively solve phases
        while self.status == SolverStatus.unsolved:
            self.solve_step()
            if self.status == SolverStatus.unsolved and not self._do_callback():
                break

        self.load_time = package_repo_stats.package_load_time - pt1
        self.solve_time = time.time() - t1

        # print stats
        if self.pr.verbosity > 2:
            from pprint import pformat
            self.pr.subheader("SOLVE STATS:")
            self.pr(pformat(self.solve_stats))

        elif self.print_stats:
            from pprint import pformat
            data = {"solve_stats": self.solve_stats}
            print >> (self.buf or sys.stdout), pformat(data)
806492
public function handleRequest()
    {
        // Create the request very early so the Resource Management has a chance to grab it:
        $this->request = Request::createFromEnvironment();
        $this->response = new Response();

        $this->checkBasicRequirementsAndDisplayLoadingScreen();

        $this->boot();
        $this->resolveDependencies();
        if (isset($this->settings['http']['baseUri'])) {
            $this->request->setBaseUri(new Uri($this->settings['http']['baseUri']));
        }

        $componentContext = new ComponentContext($this->request, $this->response);
        $this->baseComponentChain->handle($componentContext);

        $this->baseComponentChain->getResponse()->send();

        $this->bootstrap->shutdown('Runtime');
        $this->exit->__invoke();
    }
692427
def request(self, *args, **kwargs):
        """"""
        try:
            return self._http.request(*args, timeout=TIMEOUT, **kwargs)
        except Exception as exc:
            raise RequestException(exc, args, kwargs)
226311
def wait(self, **kwargs):
        """"""
        if self.request:
            self.request.wait(**kwargs)
            self.request = None
        return self.inflate()
663165
def _fill_request(self, request, rdata):
        """"""
        if not isinstance(rdata, dict):
            raise InvalidRequestError

        request['jsonrpc'] = self._get_jsonrpc(rdata)
        request['id'] = self._get_id(rdata)
        request['method'] = self._get_method(rdata)
        request['params'] = self._get_params(rdata)
142541
public function resolve()
    {
        $request = $this->process->getContext()->getRequest();
        $hasSession = $request->getSession() !== null;
        $this->data = [
            'method' => $request->getMethod(),
            'real-method' => $request->getRealMethod(),
            'uri' => $request->getUri(),
            'scriptName' => $request->getScriptName(),
            'port' => $request->getPort(),
            'ssl' => $request->isSecure(),
            'scheme' => $request->getScheme(),
            'accept-content-types' => $request->getAcceptableContentTypes(),
            'cookies' => $request->cookies->all(),
            'headers' => $request->headers->all(),
            'data' => [
                'get' => $request->query->all(),
                'post' => $request->request->all()
            ],
            'charsets' => $request->getCharsets(),
            'default-local' => $request->getDefaultLocale(),
            'local' => $request->getLocale(),
            'encodings' => $request->getEncodings(),
            'etags' => $request->getETags(),
            'session' => [
                'id' => $hasSession ? $request->getSession()->getId() : null,
                'data' => $hasSession ? $request->getSession()->all() : []
            ]
        ];
    }
1283753
def make_request
      if %i(get post put patch delete).include? @method
        HTTParty.send(@method, "#{@base_url}#{@args[:url]}", body: @args[:options], basic_auth: @auth, timeout: @timeout)
      else
        Pin::PinError.handle_bad_request
      end
    end
949365
def _request(self, method, url, params=None, headers=None, data=None):
        """"""
        if not params:
            params = {}

        # set default headers
        if not headers:
            headers = {
                'accept': '*/*'
            }
            if method == 'POST' or method == 'PUT':
                headers.update({'Content-Type': 'application/json'})
        try:
            response = requests.request(method=method, url=self.host + self.key + url, params=params,
                                        headers=headers, data=data)

            try:
                response.raise_for_status()

                response_code = response.status_code
                success = True if response_code // 100 == 2 else False
                if response.text:
                    try:
                        data = response.json()
                    except ValueError:
                        data = response.content
                else:
                    data = ''

                response_headers = response.headers

                return BurpResponse(success=success, response_code=response_code, data=data,
                                    response_headers=response_headers)
            except ValueError as e:
                return BurpResponse(success=False, message="JSON response could not be decoded {}.".format(e))
            except requests.exceptions.HTTPError as e:
                if response.status_code == 400:
                    return BurpResponse(success=False, response_code=400, message='Bad Request')
                else:
                    return BurpResponse(
                        message='There was an error while handling the request. {}'.format(response.content),
                        success=False)
        except Exception as e:
            return BurpResponse(success=False, message='Eerror is %s' % e)
280214
def _request(self, url, request_type='GET', **params):
        """"""
        try:
            _LOGGER.debug('Request %s %s', url, params)
            response = self.request(
                request_type, url, timeout=TIMEOUT.seconds, **params)
            response.raise_for_status()
            _LOGGER.debug('Response %s %s %.200s', response.status_code,
                          response.headers['content-type'], response.json())
            response = response.json()
            if 'error' in response:
                raise OSError(response['error'])
            return response
        except OSError as error:
            _LOGGER.warning('Failed request: %s', error)
1070421
protected void endRequest() {
        int oldState, newState;
        do {
            oldState = state;
            newState = oldState - 1;
        } while (!stateUpdater.compareAndSet(this, oldState, newState));
        if (newState == CLOSED) {
            handleCompleted();
        }
    }
825425
function promisePrompt(questions) {
    return new Promise(function(resolve, reject) {
        inquirer.prompt(questions, function(results) {
            resolve(results);
        });
    });
}
1246288
function Request (method, args, attempts, proxyCondition) {
    // constraint
    attempts = attempts || 0;
    if (attempts > 10)
        throw `Maximum number of request attempts exceeded (10 total) for "${args.url}"`;
    // workflow
    if (!args.url) throw 'URL undefined in smappi-cl/lib/request';
    args.data = args.data || {}; // for POST/PUT
    args.params = args.params || {}; // for GET
    args.headers = args.headers || {};
    args.options = args.options || {};
    if (!args.options.hasOwnProperty('followLocation')) {
        args.options.followLocation = true;
    }
    if (args.options.proxy == false) {
        args.proxy = null;
    } else {
        if (proxyCondition && !proxy.isActive()) {
            // if not disable proxy (for internal request, see proxy.js)
            // and there proxyCondition
            // and not active proxy
            proxy.next(); // then activate proxy if used withProxy!
        }
        args.proxy = proxy.currentHref();
    }
    args.method = method;
    if (!args.options.async) { // Synchronous
        var contentFile = ".smappi-request-content-" + process.pid;
        var syncFile = ".smappi-request-sync-" + process.pid;
        fs.writeFileSync(syncFile, "", "utf8");
        // The async request the other Node process executes
        // Start the other Node Process, executing this string
        // console.log(process.argv[0], __dirname + '/worker.js', process.pid, "'" + JSON.stringify(args) + "'");
        var syncProc = spawn(process.argv[0], [
            __dirname + '/worker.js',
            process.pid,
            JSON.stringify(args)
        ]);
        while (fs.existsSync(syncFile)) {
            // Wait while the sync file is empty
        }
        var resp = JSON.parse(fs.readFileSync(contentFile, 'utf8'));
        // Kill the child process once the file has data
        syncProc.stdin.end();
        // Remove the temporary file
        fs.unlinkSync(contentFile);
        let retry = () => {
            // if use proxy and request is broken, then turn next
            if (args.options.proxy !== false) {
                proxy.skip(); // skip current
                proxy.next();
            }
            return new Request(method, args, attempts + 1, proxyCondition);
        }
        if (resp.err) {
            if (Object.keys(resp.err).length) {
                let errStr = JSON.stringify(resp.err);
                if (resp.err.options && resp.err.options.command == 'connect') {
                    let postScriptum = '';
                    if (resp.err.options.proxy)
                        postScriptum = ' (probably proxy is wrong)';
                    logger.error(`Problem while connect for "${args.url}"${postScriptum}. Request will be retry. ERR: ${errStr}`);
                    return retry();
                } else if (resp.err.code == 'ECONNRESET') {
                    logger.error(`Connection problems for "${args.url}". Request will be retry. ERR: ${errStr}`);
                    return retry();
                } else if (resp.err.code == 'ETIMEOUT' || resp.err.code == 'ETIMEDOUT') {
                    logger.error(`Connection timeout exceeded for "${args.url}". Request will be retry. ERR: ${errStr}`);
                    return retry();
                } else if (resp.err.code == 'ENOTFOUND' && resp.err.syscall == 'getaddrinfo') {
                    let msg = `Host "${resp.err.hostname}" not found. Please verify A-record for this domain.`;
                    logger.error(msg);
                    throw msg;
                } else {
                    throw errStr;
                }
            } else if (args.proxy && resp.ctx == 'request') {
                return retry(); // Otherwise retry again
            } else if (resp.message) {
                throw resp.message;
            } else {
                throw 'Problem with connection in smappi-cl/lib/request';
            }
        } else {
            if ([301, 302].indexOf(resp.status) != -1) {
                if (args.options.followLocation) {
                    let location = url.parse(resp.headers.location);
                    if (!location.protocol) {
                        let srcUrl = url.parse(args.url);
                        // add protocol for location without proto, example "//smappi.org/path/to" or relative path "/path/to"
                        location.protocol = srcUrl.protocol;
                        if (!location.href.startsWith('//')) { // relative, not shortcut proto
                            // relative path to current hostname, example "/path/to"
                            location.hostname = srcUrl.hostname;
                        }
                    }
                    args.url = location.format();
                    return new Request(method, args, attempts + 1, proxyCondition);
                }
            }
            let response = new Response(resp, args.url);
            // console.log('RequestResponse check condition', args.url, response.status, !proxyCondition || proxyCondition(response))
            if (!proxyCondition || proxyCondition(response)) {
                // If not proxyCondition or proxyCondition is success
                // return Response
                return response;
            } else {
                return retry(); // Otherwise retry again
            }
        }
    } else {
        throw 'Temporary! Not Implemented Smappi CL Async Requests';
    }
}
789455
def _process_request(self, request, client_address):
        """"""
        try:
            self.finish_request(request, client_address)
        except Exception:
            self.handle_error(request, client_address)
        finally:
            self.shutdown_request(request)
1129622
function request(meth, url, headers, query, data, cb) {
    var req = SA(meth, url);
    if (headers) req.set(headers);
    if (query) req.query(query);
    if (data) req.send(data);
    return req.end(function(err, res) {
        if (err) return cb(err);
        return cb(null, res.text);
    });
}
724634
def request(order_Id,amount,billing_cust_name,billing_cust_address,billing_cust_city,billing_zip_code,billing_cust_state,billing_cust_country,billing_cust_email,billing_cust_tel,billing_cust_notes="",delivery_cust_name="",delivery_cust_address="",delivery_cust_city="",delivery_zip_code="",delivery_cust_state="",delivery_cust_country="",delivery_cust_email="",delivery_cust_tel="",delivery_cust_notes="")
  		checksum = getChecksum(order_Id,amount)
  		raw_request = "Merchant_Id=#{@merchant_Id}&Amount=#{amount}&Order_Id=#{order_Id}&Redirect_Url=#{@redirect_Url}&billing_cust_name=#{billing_cust_name}&billing_cust_address=#{billing_cust_address}&billing_cust_country=#{billing_cust_country}&billing_cust_state=#{billing_cust_state}&billing_cust_city=#{billing_cust_city}&billing_zip_code=#{billing_zip_code}&billing_cust_tel=#{billing_cust_tel}&billing_cust_email=#{billing_cust_email}&billing_cust_notes=#{billing_cust_notes}&delivery_cust_name=#{delivery_cust_name}&delivery_cust_address=#{delivery_cust_address}&delivery_cust_country=#{delivery_cust_country}&delivery_cust_state=#{delivery_cust_state}&delivery_cust_city=#{delivery_cust_city}&delivery_zip_code=#{delivery_zip_code}&delivery_cust_tel=#{delivery_cust_tel}&billing_cust_notes=#{delivery_cust_notes}&Checksum=#{checksum.to_s}"
  		return encrypt_data(raw_request,@working_Key,"AES-128-CBC")[0]
  	end
186218
public function RequestHandle()
    {
        if ($this->visible == false) {
            return;
        }

        $child = next(WebApplication::getApplication()->getRequest()->request_c);

        if ($child != false && $this->components[$child] instanceof Requestable) {
            $this->components[$child]->RequestHandle();
        }
    }
422043
function(){
    var args = Array.prototype.slice.apply(arguments);
    return this.reqres.request.apply(this.reqres, args);
  }