Define a request level for this class
 Takes a name, and a block which defined the request level
352238
def define_request_level(name, &block)
      level = RequestLevel.new(name, self)
      level.instance_eval &block
      @levels ||= {}
      @levels[name] = level
    end
1257209
def init_request(self):
        

        #: Build the request
        builder = Request.Builder()
        builder.url(self.url)

        #: Set any headers
        for k, v in self.headers.items():
            builder.addHeader(k, v)

        #: Get the body or generate from the data given
        body = self.body

        if body:
            #: Create the request body
            media_type = MediaType(
                __id__=MediaType.parse(self.content_type))
            request_body = RequestBody(
                __id__=RequestBody.create(media_type, body))
            #: Set the request method
            builder.method(self.method, request_body)
        elif self.method in ['get', 'delete', 'head']:
            #: Set the method
            getattr(builder, self.method)()
        else:
            raise ValueError("Cannot do a '{}' request "
                             "without a body".format(self.method))

        #: Save the okhttp request
        self.request = Request(__id__=builder.build())
1081662
def request(method, path, &block)
      uri_string = Config.artifactory.strip
      # Make sure we end up with the right number of separators.
      uri_string << '/' unless uri_string.end_with?('/')
      uri_string << path
      uri = URI(uri_string)
      request = Net::HTTP.const_get(method.to_s.capitalize).new(uri)
      request['X-Jfrog-Art-Api'] = Config.artifactory_key.strip
      block.call(request) if block
      connection.request(request)
    end
135879
function() {
      this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';

      var params = ["depth0"];
      this.setupParams(0, params);

      var current = this.topStack();
      params.splice(1, 0, current);

      this.source.push("if (!" + this.lastHelper + ") { " + current + " = blockHelperMissing.call(" + params.join(", ") + "); }");
    }
457516
@Route(method = HttpMethod.PUT, uri = "/monitor/logs/{name}")
    public Result setLevel(@Parameter("name") String loggerName, @Parameter("level") String level) {
        LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
        Logger logger = context.getLogger(loggerName);
        if (logger != null) {
            logger().info("Setting the log level of {} to {}", loggerName, level);
            ((ch.qos.logback.classic.Logger) logger).setLevel(Level.toLevel(level));
            return loggers();
        } else {
            logger().warn("Cannot set the level of logger {} - the logger does not exist", loggerName);
            return notFound();
        }
    }
491979
def complete(&block)
      name = @current_step_name or raise "No step name"
      completions << CompletionBlock.new("progression_name", name, &block)

      define_method("complete_#{name}") do
        completion = completions.find { |c| c.name == name }
        completion.run(self)
      end
    end
400138
function parse_request(){
		parent::parse_request();
		if (count($this->config->text)){
			if (isset($_GET["to"]))
				$this->request->set_filter($this->config->text[0]["name"],$_GET["to"],"<");
			if (isset($_GET["from"]))
				$this->request->set_filter($this->config->text[1]["name"],$_GET["from"],">");
		}
	}
1324953
def do_request(url, type, &_block)
      uri = URI.parse("#{api_url}/#{url}")
      http = Net::HTTP.new(uri.host, uri.port)
      http.use_ssl = true

      request = type.new(uri.request_uri, headers)

      yield request if block_given?

      response = http.request(request)

      parse!(response)
    end
1340877
def getRequest
      m = Request.new
      m.pieceIndex = @pieceIndex
      m.blockOffset = @offset
      m.blockLength = @length
      m
    end
1178348
def connection(name, &block)
      # Camelize class name
      class_name = name.to_s.split('_').map { |s| s.capitalize }.join

      connection = Class.new Cool.io::TCPSocket
      connection_builder = ConnectionBuilder.new connection
      connection_builder.instance_eval(&block)

      Coolio::Connections.const_set class_name, connection
    end
859381
public void includeRequestHeader(String name, String value) {
        checkUpdatable();
        this.headers.put(name, value);
    }
677245
function( name, value ) {
					if ( completed == null ) {
						name = requestHeadersNames[ name.toLowerCase() ] =
							requestHeadersNames[ name.toLowerCase() ] || name;
						requestHeaders[ name ] = value;
					}
					return this;
				}
106004
function header (request) {

    var headers = assign({}, Http.headers.common,
        !request.crossOrigin ? Http.headers.custom : {},
        Http.headers[toLower(request.method)]
    );

    each(headers, function (value, name) {
        if (!request.headers.has(name)) {
            request.headers.set(name, value);
        }
    });

}
870087
function  (options, status) {
  this.name = ''
  this.error = options.error || 'invalid_request'
  this.error_description = options.error_description
  this.redirect_uri = options.redirect_uri
  this.statusCode = options.statusCode || 400
}
506977
def requires(self, *names):
        
        if len(names) == 0:
            raise ValueError("You should give at least one block name")
    
        if self._blocks is not None and len(self._blocks) > 0:
            raise ReliureError("Method 'requires' should be called only once before adding any composant")
        for name in names:
            if name in self._blocks:
                raise ValueError("Duplicate block name %s" % name)
            self._blocks[name] = Block(name)
        self._logger.info(" ** requires ** %s", names)
1064213
def stage_http_request(self, conn_id, version, url, target, method, headers,
                           payload):
        """"""
        # pylint: disable=attribute-defined-outside-init
        self._http_request_version = version
        self._http_request_conn_id = conn_id
        self._http_request_url = url
        self._http_request_target = target
        self._http_request_method = method
        self._http_request_headers = headers
        self._http_request_payload = payload
490920
def request(self, method, url, url_params=empty.dict, headers=empty.dict, timeout=None, **params):
        """"""
        raise NotImplementedError("Concrete services must define the request method")