Example usage for org.apache.http.client.fluent Request getClass

List of usage examples for org.apache.http.client.fluent Request getClass

Introduction

In this page you can find the example usage for org.apache.http.client.fluent Request getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.schedulesdirect.api.utils.HttpUtils.java

static public Header[] scrapeHeaders(Request r) {
    try {/*  w  w  w .  j  av a 2s.  c  o m*/
        Field f = r.getClass().getDeclaredField("request");
        f.setAccessible(true);
        HttpRequestBase req = (HttpRequestBase) f.get(r);
        return req.getAllHeaders();
    } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
        LOG.error("Error accessing request headers!", e);
        return new Header[0];
    }
}