Allow getting headers in a generified way and return defaultValue if the key does not exist.

@param name The key to get
@param defaultValue value returned when the key does not exist
@return {String} The found object
775733
public String getHeader(@NotNull final String name, String defaultValue) {
        if (headers().contains(name)) {
            return getHeader(name);
        } else {
            return defaultValue;
        }
    }
1286415
public function param(string $name, $defaultValue = null)
    {
        if (array_key_exists($name, $this->parameters)) {
            return $this->parameters[$name];
        }

        return $defaultValue;
    }
916747
public String getHeaderValue(final String headerName) {
     if (headerName == null) { return null; }
     return request.headers().get(headerName);
   }
1014878
public String get(String key, String defaultValue) {
		addToDefaults(key, defaultValue);
		String value = get(key);
		if (value == null) {
			return defaultValue;
		} else {
			return value;
		}
	}
28269
@SuppressWarnings("unchecked")
    public <R> R getHeader(String name) {
        return (R) headers().get(name);
    }
676099
public String getString(String name, String defaultValue) {
        String value = getProperties().getProperty(name, defaultValue);
        value = overrides.getProperty(name, value);

        return value;
    }
338633
public Collection<Object> getPropertyOrDefault(final String name, final Collection<Object> defaultValues) {
        if (this.properties.containsKey(name)) {
            return this.properties.get(name);
        }
        return defaultValues;
    }
1034312
public String getProperty(String key, String defaultValue) {
        String value = getProperty(key, String.class);
        return StringUtils.isEmpty(value) ? defaultValue : value;
    }
267455
public int getIntHeader(int radix, String name, int defaultValue) {
        return header.getIntValue(radix, name, defaultValue);
    }
453774
public function getGet($name = null, $defaultValue = null) 
    {
        if ($name === null) {
            return $_GET;
        }
        return (isset($_GET[$name])) ? $_GET[$name] : $defaultValue;
    }
521542
public Collection<Object> getPropertyOrDefault(final String name, final Object... defaultValues) {
        if (this.properties.containsKey(name)) {
            return this.properties.get(name);
        }
        return Arrays.stream(defaultValues).collect(Collectors.toList());
    }
205914
public function getSetting( string $name, $defaultValue = null )
	{
		return $this->isSettingSet($name)
			? $this->settings[$name]
			: $defaultValue;
	}
1215039
public String hidden (String name, Object defaultValue)
    {
        return fixedHidden(name, getValue(name, defaultValue));
    }
1225022
public function get(string $name, $default = null)
    {
        $key = strtolower($name);
        if (!array_key_exists($key, $this->headers)) {
            return $default;
        }

        return $this->headers[$key]->getValuesAsString();
    }
859227
public function getHeader($key, $defaultValue = null) {
		if (!is_string($key) || $key === '') {
			return $defaultValue;
		}

		$key = strtoupper(str_replace('-', '_', $key));

		return $_SERVER['HTTP_' . $key] ?? $_SERVER[$key] ?? $defaultValue;
	}
966835
public String getProperty(String key,String defaultValue)
    {
        //get property value
        return this.PROPERTIES.getProperty(key,defaultValue);
    }
173767
def getheader (self, name, default=None):
        
        value = self.headers.get(name)
        if value is None:
            return default
        return unicode_safe(value, encoding=HEADER_ENCODING)