Makes the http method names to express friendly name
543527
function addHttpEndpointNames(spec) {
  for(var i = 0; i < spec.endpoints.length; i++) {
    var endpoint = spec.endpoints[i];
    if (endpoint.response.contentType.contentType.toLowerCase() === 'javascript') {
      endpoint.response.contentType.contentType = 'application/json';
      endpoint.response.contentType.eval = true;
    } else {
      endpoint.response.content = endpoint.response.content.replace(/(\r\n|\n|\r)/gm,"");
    }
    endpoint.httpMethod = endpoint.method.toLowerCase();
  }
  return spec;
}
462512
def cmd_http_methods(self):
        
        methods = defaultdict(int)
        for line in self._valid_lines:
            methods[line.http_request_method] += 1
        return methods
20531
def switch_name_style(self, http_protocol_version):
		
		new_headers = WHTTPHeaders()
		new_headers.__normalization_mode = http_protocol_version
		names = self.headers()
		for name in names:
			new_headers.add_headers(name, *self.get_headers(name))
		for cookie_name in self.__set_cookies.cookies():
			new_headers.__set_cookies.add_cookie(self.__set_cookies[cookie_name].copy())
		return new_headers
1348685
function getHttpMethod() {
    let http = require('http');
    let lowerCaseMethods = http.METHODS.map(function (method) {
        return method.toLowerCase();
    });
    return lowerCaseMethods;
}
724230
def _normalize_django_header_name(header):
        """"""
        # Remove HTTP_ prefix.
        new_header = header.rpartition('HTTP_')[2]
        # Camel case and replace _ with -
        new_header = '-'.join(
            x.capitalize() for x in new_header.split('_'))

        return new_header
150057
def cli(self, method):
        """"""
        routes = getattr(method, '_hug_cli_routes', [])
        routes.append(self.route)
        method._hug_cli_routes = routes
        return method
152615
function clean(method) {
  for (let m of methods) {
    if (new RegExp(m, 'i').test(method)) {
      return m;
    }
  }

  throw new Error(`Invalid method name: ${method}`);
}
1274424
def http_handler(name, logname, host, url, method="GET"):
    

    return wrap_log_handler(logging.handlers.HTTPHandler(
        host, url, method=method))
101286
function sanitize (fn) {
  return function (/* path, ...middleware */) {
    var middleware = []
    var startindex = 0
    var endindex = arguments.length
    var path
    var options

    if (typeof arguments[0] === 'string') {
      path = arguments[0]
      startindex = 1
    }

    if (typeof arguments[arguments.length - 1] === 'object') {
      endindex = arguments.length - 1
      options = arguments[endindex]
    }

    // Concat all the middleware functions.
    for (var i = startindex; i < endindex; i++) {
      middleware.push(arguments[i])
    }

    middleware = flatten(middleware)

    if (middleware.length === 0) {
      throw new TypeError('Expected a function but got no arguments')
    }

    if (middleware.length === 1) {
      middleware = middleware[0]
    } else {
      middleware = compose(middleware)
    }

    fn.call(this, path, middleware, extend({}, this._options, options))

    return this
  }
}
434324
def replace_methodname(format_string, methodname):
    

    methodnamehyphen = methodname.replace('_', '-')
    ret = format_string
    ret = ret.replace('{methodname}', methodname)
    ret = ret.replace('{methodnamehyphen}', methodnamehyphen)
    return ret
296307
private void processVirtualHostName(HttpMethod httpMethodProxyRequest, HttpServletRequest httpServletRequest) {
        String virtualHostName;
        if (httpMethodProxyRequest.getRequestHeader(STRING_HOST_HEADER_NAME) != null) {
            virtualHostName = HttpUtilities.removePortFromHostHeaderString(httpMethodProxyRequest.getRequestHeader(STRING_HOST_HEADER_NAME).getValue());
        } else {
            virtualHostName = HttpUtilities.getHostNameFromURL(httpServletRequest.getRequestURL().toString());
        }
        httpMethodProxyRequest.getParams().setVirtualHost(virtualHostName);
    }
114459
function provideAppMethods(model, methodsProto) {
  /*jshint immed:false */
  var key, method,
      cname = inflect.camelize(model.context),
      scname = inflect.singularize(cname),
      Application = app.constructor;
      
  var pluralize = /^(get|find|delete|destroy)$/
      
  for (key in methodsProto) {
    var suffix = (key.slice(-3) === 'All') ? cname : scname;
    method = key + suffix;
    (function(model, key, method) {
      app.model[method] = function() {
        model[key].apply(model, arguments);
      }
      if (pluralize.test(key)) {
        app.model[key + inflect.pluralize(suffix)] = app.model[method];
      }
    }).call(this, model, key, method);
  }
}
1073867
function fixHttpMethod (fn, name) {
  if (fn.http && fn.http.verb && fn.http.verb.toLowerCase() === 'put') {
    fn.http.verb = 'patch'
  }
}
115730
function buildMethodName(req) {
    return [
        req.params.service,
        req.params.subservice
    ].filter(Boolean).join('-');
}
177445
function HttpTool(){
        this.settings = {};
        this.urlObject = {};
        this.dataToWrite = '';
        // ********** Helper Functions/Members **********
        
        var validMethods = ['GET', 'PUT', 'POST', 'DELETE', 'PATCH'];
        
        /**
        * Make sure that settings has at least property of url and method.
        * @return {boolean} whether settings is valid.
        */ 
        this.isSettingValid = function(settings){
            if (_.isEmpty(settings)) {
                return false;
            }
            if ( ! (settings.hasOwnProperty('url') && settings.hasOwnProperty('method'))) {
                return false;
            }
            if (_.isEmpty(settings.url) || _.isEmpty(settings.method)) {
                return false;
            }
            if (_.indexOf(validMethods, settings.method) === -1) {
                return false;    
            }

            return true;
        };

        /**
        * Parse and convert setting into a urlObject that suitable for 
        * http/https module in NodeJs.
        * @return {object} - the object that suitable for Node http/https module.
        */
        this.setupUrlOptions = function(settings) {
                
            var urlTool = require('url');
            var urlObject = {};

            // Parse the string into url options
            if (typeof (settings.url) === 'string') {
                urlObject = urlTool.parse(settings.url);
            }
            else {
                urlObject = settings.url;
            }
            // set the REST options
            urlObject.method = settings.method;
        
            // set up the REST headers
            if (! _.isEmpty(settings.headers)){
                urlObject.headers = settings.headers;
            }
            else {
                urlObject.headers = {};
            }
            
            urlObject.headers['Content-Length'] = 0;
            if (settings.hasOwnProperty('data')){
                switch (typeof settings.data) {
                    case 'object':
                        this.dataToWrite = JSON.stringify(settings.data);
                        urlObject.headers['Content-Type'] = 'application/json';
                        break;
                    case 'string':
                        this.dataToWrite = settings.data;
                        break;
                    default:
                        throw new TypeError("Data field can only be object or string," + 
                                            " but got " + (typeof settings.data));
                                        }
                urlObject.headers['Content-Length'] = Buffer.byteLength(this.dataToWrite);
            }
            
            if (! _.isEmpty(settings.credential)){
                if (!_.isEmpty(settings.credential.password) &&
                    _.isEmpty(settings.credential.username)) {
                    throw new Error('Please provide username and password '+
                                    'for basic authentication.');
                }
                else {
                    urlObject.auth = settings.credential.username +':'+
                    settings.credential.password;
                }
            }
            
            // set the protolcol paramter
            if (urlObject.protocol.substr(-1) !== ':') {
                urlObject.protocol = urlObject.protocol + ':';
            }

            urlObject.rejectUnauthorized = settings.verifySSL || false;
            urlObject.recvTimeoutMs = settings.recvTimeoutMs;

            return urlObject;
        };
    }
578587
private String friendlyName(Token token) {
        return token.kind == EOF ? EOF_STRING : token.kind == UNTERMINATED_COMMENT ? UNTERMINATED_COMMENT_STRING : token.image;
    }
482270
def raw
      headers = http_headers.map { |k, v| "#{k}: #{v}\r\n" }.join
      format "%s %s %s\r\n%s\r\n%s", request_method.upcase, fullpath, env["SERVER_PROTOCOL"], headers, body_string
    end