Tabnine Logo
HttpHelper.appendHeader
Code IndexAdd Tabnine to your IDE (free)

How to use
appendHeader
method
in
org.apache.camel.http.common.HttpHelper

Best Java code snippets using org.apache.camel.http.common.HttpHelper.appendHeader (Showing top 5 results out of 315)

origin: org.apache.camel/camel-http-common

protected void populateRequestParameters(HttpServletRequest request, HttpMessage message) throws Exception {
  //we populate the http request parameters without checking the request method
  Map<String, Object> headers = message.getHeaders();
  Enumeration<?> names = request.getParameterNames();
  while (names.hasMoreElements()) {
    String name = (String)names.nextElement();
    // there may be multiple values for the same name
    String[] values = request.getParameterValues(name);
    LOG.trace("HTTP parameter {} = {}", name, values);
    if (values != null) {
      for (String value : values) {
        if (headerFilterStrategy != null
          && !headerFilterStrategy.applyFilterToExternalHeaders(name, value, message.getExchange())) {
          HttpHelper.appendHeader(headers, name, value);
        }
      }
    }
  }
}
origin: org.apache.camel/camel-http-common

protected void readHeaders(HttpServletRequest request, HttpMessage message) {
  LOG.trace("readHeaders {}", request);
  Map<String, Object> headers = message.getHeaders();
  //apply the headerFilterStrategy
  Enumeration<?> names = request.getHeaderNames();
  while (names.hasMoreElements()) {
    String name = (String)names.nextElement();
    String value = request.getHeader(name);
    // use http helper to extract parameter value as it may contain multiple values
    Object extracted = HttpHelper.extractHttpParameterValue(value);
    // mapping the content-type
    if (name.toLowerCase().equals("content-type")) {
      name = Exchange.CONTENT_TYPE;
    }
    if (headerFilterStrategy != null
        && !headerFilterStrategy.applyFilterToExternalHeaders(name, extracted, message.getExchange())) {
      HttpHelper.appendHeader(headers, name, extracted);
    }
  }
  if (request.getCharacterEncoding() != null) {
    headers.put(Exchange.HTTP_CHARACTER_ENCODING, request.getCharacterEncoding());
    message.getExchange().setProperty(Exchange.CHARSET_NAME, request.getCharacterEncoding());
  }
  try {
    populateRequestParameters(request, message);
  } catch (Exception e) {
    throw new RuntimeCamelException("Cannot read request parameters due " + e.getMessage(), e);
  }
}
origin: org.apache.camel/camel-http-common

if (headerFilterStrategy != null
    && !headerFilterStrategy.applyFilterToExternalHeaders(name, value, message.getExchange())) {
  HttpHelper.appendHeader(headers, name, value);
origin: org.apache.camel/camel-jetty9

HttpHelper.appendHeader(headers, name, value);
if (getHeaderFilterStrategy() != null
  && !getHeaderFilterStrategy().applyFilterToExternalHeaders(name, value, message.getExchange())) {
  HttpHelper.appendHeader(headers, name, value);
origin: org.apache.camel/camel-http

HttpHelper.appendHeader(answer.getHeaders(), name, extracted);
org.apache.camel.http.commonHttpHelperappendHeader

Javadoc

Appends the key/value to the headers.

This implementation supports keys with multiple values. In such situations the value will be a java.util.List that contains the multiple values.

Popular methods of HttpHelper

  • setCharsetFromContentType
  • deserializeJavaObjectFromStream
    Deserializes the input stream to a Java object
  • extractHttpParameterValue
    Extracts the parameter value. This implementation supports HTTP multi value parameters which is base
  • isStatusCodeOk
    Checks whether the given http status code is within the ok range
  • readResponseBodyFromInputStream
    Reads the response body from the given input stream.
  • writeObjectToStream
    Writes the given object as response body to the output stream
  • createMethod
    Creates the HttpMethod to use to call the remote server, often either its GET or POST.
  • createURI
    Creates the URI to invoke.
  • createURL
    Creates the URL to invoke.
  • getCharsetFromContentType
  • readRequestBodyFromServletRequest
    Reads the response body from the given http servlet request.
  • urlRewrite
    Processes any custom org.apache.camel.http.common.UrlRewrite.
  • readRequestBodyFromServletRequest,
  • urlRewrite,
  • writeObjectToServletResponse

Popular in Java

  • Start an intent from android
  • findViewById (Activity)
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now