Tabnine Logo
HttpHeader.value
Code IndexAdd Tabnine to your IDE (free)

How to use
value
method
in
com.hotels.styx.api.HttpHeader

Best Java code snippets using com.hotels.styx.api.HttpHeader.value (Showing top 10 results out of 315)

origin: HotelsDotCom/styx

@Override
public boolean matchesSafely(HttpHeader actual) {
  return actual.name().equalsIgnoreCase(name.toString()) && value.matches(actual.value());
}
origin: HotelsDotCom/styx

@Test
public void createsSingleValueHeader() {
  HttpHeader header = header("name", "value");
  assertThat(header.toString(), is("name=value"));
  assertThat(header.value(), is("value"));
  assertThat(header.values(), contains("value"));
}
origin: HotelsDotCom/styx

@Factory
public static Matcher<HttpHeader> header(HttpHeader header) {
  return new HeaderMatcher(header.name(), is(header.value()));
}
origin: HotelsDotCom/styx

@Test
public void createsMultipleValueHeader() {
  HttpHeader header = header("name", "value1", "value2");
  assertThat(header.toString(), is("name=value1, value2"));
  assertThat(header.value(), is("value1"));
  assertThat(header.values(), contains("value1", "value2"));
}
origin: com.hotels.styx/styx-api

private void prepareRequest(HttpURLConnection connection, HttpRequest request) throws IOException {
  connection.setRequestMethod(request.method().name());
  connection.setRequestProperty("Connection", "close");
  connection.setDoInput(true);
  for (HttpHeader httpHeader : request.headers()) {
    connection.addRequestProperty(httpHeader.name(), httpHeader.value());
  }
}
origin: HotelsDotCom/styx

@Override
public HttpHeaders getHeaders() {
  List<HttpHeader> list = stream(styxRequest.headers().spliterator(), false)
      .map(styxHeader -> httpHeader(styxHeader.name(), styxHeader.value()))
      .collect(toList());
  return new HttpHeaders(list);
}
origin: HotelsDotCom/styx

@Override
public boolean matchesSafely(HttpHeader actual) {
  return actual.name().equalsIgnoreCase(name.toString()) && value.matches(actual.value());
}
origin: com.hotels.styx/styx-api

public SELF headers(HttpHeader... headers) {
  for (HttpHeader header : headers) {
    checkNotCookie(header.name());
    this.headers.set(header.name(), header.value());
  }
  return (SELF) this;
}
origin: HotelsDotCom/styx

@Factory
public static Matcher<HttpHeader> header(HttpHeader header) {
  return new HeaderMatcher(header.name(), is(header.value()));
}
origin: HotelsDotCom/styx

public HttpResponse toNettyResponse(LiveHttpResponse httpResponse) {
  io.netty.handler.codec.http.HttpVersion version = toNettyVersion(httpResponse.version());
  HttpResponseStatus httpResponseStatus = HttpResponseStatus.valueOf(httpResponse.status().code());
  DefaultHttpResponse nettyResponse = new DefaultHttpResponse(version, httpResponseStatus, false);
  httpResponse.headers().forEach(httpHeader ->
      nettyResponse.headers().add(httpHeader.name(), httpHeader.value()));
  return nettyResponse;
}
com.hotels.styx.apiHttpHeadervalue

Javadoc

Return the first header value.

Popular methods of HttpHeader

  • name
    Return header name.
  • header
    Creates a header with a name and one or more values.
  • <init>
  • equals
  • toString
  • values
    Return all header values.

Popular in Java

  • Making http requests using okhttp
  • getSystemService (Context)
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Reference (javax.naming)
  • Top 12 Jupyter Notebook extensions
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