congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
SimpleResponse$Builder.withHeader
Code IndexAdd Tabnine to your IDE (free)

How to use
withHeader
method
in
com.atlassian.oai.validator.model.SimpleResponse$Builder

Best Java code snippets using com.atlassian.oai.validator.model.SimpleResponse$Builder.withHeader (Showing top 5 results out of 315)

origin: com.atlassian.oai/swagger-request-validator-core

/**
 * Adds a response header to this builder. If there was already a header with this
 * name the values will be added.
 * <p>
 * Headers are treated case insensitive.
 *
 * @param name   the header name
 * @param values the values for this header
 * @return this builder
 */
public Builder withHeader(final String name, final String... values) {
  return withHeader(name, asList(values));
}
origin: com.atlassian.oai/swagger-request-validator-mockmvc

/**
 * Builds a {@link Response} for the OpenAPI validator out of the
 * original {@link MockHttpServletResponse}.
 *
 * @param originalResponse the original {@link MockHttpServletResponse}
 */
@Nonnull
public static Response of(@Nonnull final MockHttpServletResponse originalResponse) {
  requireNonNull(originalResponse, "An original response is required");
  final SimpleResponse.Builder builder = new SimpleResponse.Builder(originalResponse.getStatus())
      .withBody(getBody(originalResponse));
  originalResponse.getHeaderNames()
      .forEach(header -> builder.withHeader(header, originalResponse.getHeaders(header)));
  return builder.build();
}
origin: com.atlassian.oai/swagger-request-validator-wiremock

  /**
   * Builds a {@link Response} for the OpenAPI validator out of the
   * original {@link com.github.tomakehurst.wiremock.http.Response}.
   *
   * @param originalResponse the original {@link com.github.tomakehurst.wiremock.http.Response}
   */
  @Nonnull
  public static Response of(@Nonnull final com.github.tomakehurst.wiremock.http.Response originalResponse) {
    requireNonNull(originalResponse, "An original response is required");
    final SimpleResponse.Builder builder = new SimpleResponse.Builder(originalResponse.getStatus())
        .withBody(originalResponse.getBodyAsString());
    originalResponse.getHeaders().all().forEach(header -> builder.withHeader(header.key(), header.values()));
    return builder.build();
  }
}
origin: com.atlassian.oai/swagger-request-validator-restassured

  /**
   * Builds a {@link Response} for the OpenAPI validator out of the
   * original {@link io.restassured.response.Response}.
   *
   * @param originalResponse the original {@link io.restassured.response.Response}
   */
  @Nonnull
  public static Response of(@Nonnull final io.restassured.response.Response originalResponse) {
    requireNonNull(originalResponse, "An original response is required");
    final SimpleResponse.Builder builder = new SimpleResponse.Builder(originalResponse.getStatusCode())
        .withBody(originalResponse.getBody().asString());
    if (originalResponse.getHeaders() != null) {
      originalResponse.getHeaders().forEach(header -> builder.withHeader(header.getName(), header.getValue()));
    }
    return builder.build();
  }
}
origin: com.atlassian.oai/swagger-request-validator-core

/**
 * Sets the content type header on this builder.
 * <p>
 * Equivalent to: <pre>withHeader("Content-Type", contentType);</pre>
 *
 * @param contentType The content type to set
 *
 * @return this builder
 */
public Builder withContentType(final String contentType) {
  return withHeader(CONTENT_TYPE, contentType);
}
com.atlassian.oai.validator.modelSimpleResponse$BuilderwithHeader

Javadoc

Adds a response header to this builder. If there was already a header with this name the values will be added.

Headers are treated case insensitive.

Popular methods of SimpleResponse$Builder

  • <init>
    Creates a SimpleResponse.Builder with the given HTTP status code.
  • build
    Builds a SimpleResponse out of this builder.
  • withBody
    Adds a response body to this builder.
  • status
    Creates a SimpleResponse.Builder with the given HTTP status code.

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • setRequestProperty (URLConnection)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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