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

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

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

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

Object extracted = HttpHelper.extractHttpParameterValue(value);
if (strategy != null && !strategy.applyFilterToExternalHeaders(name, extracted, exchange)) {
  HttpHelper.appendHeader(answer.getHeaders(), name, extracted);
org.apache.camel.http.commonHttpHelperextractHttpParameterValue

Javadoc

Extracts the parameter value.

This implementation supports HTTP multi value parameters which is based on the syntax of [value1, value2, value3] by returning a List containing the values.

If the value is not a HTTP mulit value the value is returned as is.

Popular methods of HttpHelper

  • appendHeader
    Appends the key/value to the headers. This implementation supports keys with multiple values. In suc
  • setCharsetFromContentType
  • deserializeJavaObjectFromStream
    Deserializes the input stream to a Java object
  • 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

  • Creating JSON documents from java classes using gson
  • getSystemService (Context)
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Github Copilot 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