Example usage for org.apache.http.client.cache HeaderConstants OPTIONS_METHOD

List of usage examples for org.apache.http.client.cache HeaderConstants OPTIONS_METHOD

Introduction

In this page you can find the example usage for org.apache.http.client.cache HeaderConstants OPTIONS_METHOD.

Prototype

String OPTIONS_METHOD

To view the source code for org.apache.http.client.cache HeaderConstants OPTIONS_METHOD.

Click Source Link

Usage

From source file:org.apache.http.impl.client.cache.CachingExec.java

boolean clientRequestsOurOptions(final HttpRequest request) {
    final RequestLine line = request.getRequestLine();

    if (!HeaderConstants.OPTIONS_METHOD.equals(line.getMethod())) {
        return false;
    }// w w  w.  j  av  a  2 s  .  c  om

    if (!"*".equals(line.getUri())) {
        return false;
    }

    if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue())) {
        return false;
    }

    return true;
}

From source file:org.apache.http.impl.client.cache.CachingHttpAsyncClient.java

boolean clientRequestsOurOptions(final HttpRequest request) {
    final RequestLine line = request.getRequestLine();

    if (!HeaderConstants.OPTIONS_METHOD.equals(line.getMethod())) {
        return false;
    }//from  w w w  .j  av  a  2  s  .  co m

    if (!"*".equals(line.getUri())) {
        return false;
    }
    return "0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue());
}

From source file:org.apache.http.impl.client.cache.CachingHttpClient.java

boolean clientRequestsOurOptions(HttpRequest request) {
    RequestLine line = request.getRequestLine();

    if (!HeaderConstants.OPTIONS_METHOD.equals(line.getMethod()))
        return false;

    if (!"*".equals(line.getUri()))
        return false;

    if (!"0".equals(request.getFirstHeader(HeaderConstants.MAX_FORWARDS).getValue()))
        return false;

    return true;//from w w w  .  ja va 2s .co m
}