/*
Execute a request
550750
function(url, options, defaults) {
            var d = Q.defer();
            options = options || {};
            options = _.extend(options, defaults, {
                "url": url
            });
            var r = new Requests(options);
            r.on("done", function(content) {
                d.resolve(content);
            });
            r.on("error", function(err) {
                var e = new Error(err.textStatus+": "+err.content);
                e.textStatus = err.textStatus,
                e.httpRes = err.content;
                d.reject(e);
            });

            r.execute();
            return d.promise;
        }
651398
private void handleRequest(long requestId, Object request, HandlerHolder handler) {
    @SuppressWarnings("unchecked")
    CompletableFuture<Object> responseFuture = handler.handler.apply(request);
    if (responseFuture != null) {
      responseFuture.whenComplete((response, error) -> {
        ThreadContext context = ThreadContext.currentContext();
        if (context == null) {
          this.context.executor().execute(() -> {
            if (error == null) {
              handleRequestSuccess(requestId, response, this.context);
            } else {
              handleRequestFailure(requestId, error, this.context);
            }
          });
        } else {
          if (error == null) {
            handleRequestSuccess(requestId, response, context);
          } else {
            handleRequestFailure(requestId, error, context);
          }
        }
      });
    }
  }
54605
function (format, callbackFn) {
                    var self = this,
                        args =
                            [
                                format
                            ],
                        url = this.options.hostAndPort + '/page/functions/renderBase64';
                    this.options.debug && console.log('calling execute method  for %s and with %d params: %s'.grey, url, args.length, JSON.stringify(args));

                    request.post(url, {form:{ args:JSON.stringify(args)}},
                        function (error, response, body) {
                            error && console.error(error);
                            if (response && response.statusCode === 200) {
                                callbackFn && callbackFn.call(self, body);
                            }
                            else {
                                console.log('error in response %s'.red.bold, body);
                                callbackFn && callbackFn.call(self, false, body);
                            }
                        });
                    return this;
                }
688338
public static void executeAsync(Executor executor, HttpRequestBase request, FutureCallback<HttpResponse> callback) {

		try {
			executor.execute(new AsyncHttpCall(request, callback));
		}
		catch (Exception e) {
			log.error("Failed to execute asynchronously: " + request.getMethod() + " " + request.getURI().toString());
		}
	}
468354
function execute(req, res) {
  var save = undefined;
  if(req.args[0] !== undefined) {
    save = req.args[0] === true;
  }
  this.shutdown({save: save, code: 0}, process.exit);
}
28723
function execute(req, res) {
  req.conn.monitor(this);
  res.send(null, Constants.OK);
}
647485
function makeRequest(method, auth, url, qs, data, cb) {		// eslint-disable-line max-params
	const options = {
		method: method,
		headers: {
			'Content-Type': 'application/json',
			'Authorization': auth
		},
		url: url, // for debugging set to: "https://httpbin.org/get"
		qs: qs
	}

	if(data) {
		options.body = JSON.stringify(data)
	}

	request(options, createResponseHandler(cb))
}
1365502
public function execute(Request $req = null, Response $res = null)
    {
        $auto = false;
        if (!isset($req)) {
            $auto = true;
            $req  = (new Request())->fromGlobals();
            $res  = (new Response($req));
        } else if (!isset($res)) {
            throw new App\Exception('You must pass a Response object when passing a Request object');
        }

        $this->param('req', $req)
             ->param('res', $res);
        try {
            $this->preExecute($req, $res);
            foreach ($this->_executables as $executable) {
                if ($executable instanceof Executable && !$executable instanceof App) {
                    $executable->preExecute($req, $res);
                }
            }
            $result = null;
            foreach ($this->_executables as $executable) {
                $result = call_user_func($executable instanceof Executable
                    ? [$executable, 'execute']
                    : $executable, $req, $res);
                if (isset($result)) {
                    break;
                }
            }
            if (!$result && !$this->_isSubapp) {
                if (isset($this->_failureHandler)) {
                    $result = call_user_func($this->_failureHandler, $req, $res);
                } else {
                    throw new App\Exception('Nothing successfully handled the request');
                }
            }
            foreach ($this->_executables as $executable) {
                if ($executable instanceof Executable && !$executable instanceof App) {
                    $executable->postExecute($req, $res);
                }
            }
            $this->postExecute($req, $res);
        } catch (\Exception $e) {
            if (isset($this->_errorHandler)) {
                $result = call_user_func($this->_errorHandler, $req, $res, $e);
            } else {
                throw $e;
            }
        }
        $this->param('req', null)
             ->param('res', null);
        
        if ($auto) {
            $res->toGlobals();
        } else {
            return $result;
        }
    }
875287
public function executeRequest()
    {

        // curl general
        $curl_options = [
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYPEER => true,
            CURLOPT_CUSTOMREQUEST  => $this->requestType
        ];

        // set to post
        if ($this->requestType == 'POST') {
            $curl_options[CURLOPT_POST] = true;
        }

        // build url and append query params
        $url = $this->url($this->getUrl());
        $this->params[$this->oauth2->getAccessTokenName()] = $this->oauth2->getAccessToken();
        if (count($this->getParams()) > 0) {
            $url->setQuery($this->getParams());
        }
        $curl_options[CURLOPT_URL] = $url->val();

        // check request headers
        if (count($this->getHeaders()) > 0) {
            $header = [];
            foreach ($this->getHeaders() as $key => $parsed_urlvalue) {
                $header[] = "$key: $parsed_urlvalue";
            }
            $curl_options[CURLOPT_HTTPHEADER] = $header;
        }

        // init curl
        $ch = curl_init();
        curl_setopt_array($ch, $curl_options);

        // https handling
        if ($this->certificateFile != '') {
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
            curl_setopt($ch, CURLOPT_CAINFO, $this->certificateFile);
        } else {
            // bypass ssl verification
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        }

        // execute the curl request
        $result = curl_exec($ch);
        $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        $content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);
        if ($curl_error = curl_error($ch)) {
            throw new OAuth2Exception($curl_error);
        } else {
            $json_decode = $this->jsonDecode($result, true);
        }
        curl_close($ch);

        return [
            'result'       => (null === $json_decode) ? $result : $json_decode,
            'code'         => $http_code,
            'content_type' => $content_type
        ];
    }
177903
protected String executeRequest(HttpRequestBase request) throws IOException {
        HttpResponse response = client.execute(request);
        HttpEntity entity = response.getEntity();
        if (response.getStatusLine().getStatusCode() == 200) {
            return EntityUtils.toString(entity, "utf-8");
        } else {
            EntityUtils.consumeQuietly(entity);
            throw new IOException(response.getStatusLine().toString());
        }
    }
341076
public T execute() throws ApiException, IOException {
        return client.executeRequest(this.builder, expectedCode, responseClass, needAuth);
    }
278390
@Override
    public T execute() throws Auth0Exception {
        okhttp3.Request request = createRequest();
        try (Response response = client.newCall(request).execute()) {
            return parseResponse(response);
        } catch (Auth0Exception e) {
            throw e;
        } catch (IOException e) {
            throw new Auth0Exception("Failed to execute request", e);
        }
    }
1093354
public function execute()
    {
        /** @var EventHandler $eventHandler */
        $eventHandler = $this->make(EventHandler::class);
        $eventHandler->trigger(BeforeExecute::class);

        /** @var Request $request */
        $request = $this->make(Request::class);
        $request->compute();
    }
1123605
function (request, options) {
    var action, target, method, emitter;

    while (this._actions.length) {
      action = this._actions.shift();
      target = action.target;
      method = action.method;
      emitter = new ActionEmitter;

      if (!(method in target)) {
        throw new Error("Can't call action " + method + ' on target for uri ' + request.uri);
      }

      this._emitters.push(emitter);

      target[method].call(target, request, options, emitter);
    }
  }
803278
function execute(req, res) {
  if(req.info.command.sub) {
    this.delegate(req, res);
  // no subcommand return command list
  }else{
    var list = getList.call(this);
    return res.send(null, list);
  }
}
440035
function execute(req, res) {
  // setup the transaction
  req.conn.transaction = new Transaction();
  res.send(null, Constants.OK);
}
460746
function execute(req, res) {
  // TODO: ensure a conflict is triggered on all watched keys
  this.store.flushall();
  res.send(null, Constants.OK);
}