Class OkHttpPoster

  • All Implemented Interfaces:
    com.newrelic.telemetry.http.HttpPoster

    public class OkHttpPoster
    extends java.lang.Object
    implements com.newrelic.telemetry.http.HttpPoster
    • Constructor Summary

      Constructors 
      Constructor Description
      OkHttpPoster​(java.net.Proxy proxy, okhttp3.Authenticator proxyAuthenticator, java.time.Duration callTimeout)
      Create an OkHttpPoster with a Proxy.
      OkHttpPoster​(java.time.Duration callTimeout)
      Create an OkHttpPoster without a Proxy.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.newrelic.telemetry.http.HttpResponse post​(java.net.URL url, java.util.Map<java.lang.String,​java.lang.String> headers, byte[] body, java.lang.String mediaType)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • OkHttpPoster

        public OkHttpPoster​(java.time.Duration callTimeout)
        Create an OkHttpPoster without a Proxy.
        Parameters:
        callTimeout - call timeout
      • OkHttpPoster

        public OkHttpPoster​(java.net.Proxy proxy,
                            okhttp3.Authenticator proxyAuthenticator,
                            java.time.Duration callTimeout)
        Create an OkHttpPoster with a Proxy.
        Parameters:
        proxy - the Proxy
        proxyAuthenticator - the proxy Authenticator
        callTimeout - call timeout
    • Method Detail

      • post

        public com.newrelic.telemetry.http.HttpResponse post​(java.net.URL url,
                                                             java.util.Map<java.lang.String,​java.lang.String> headers,
                                                             byte[] body,
                                                             java.lang.String mediaType)
                                                      throws java.io.IOException
        Specified by:
        post in interface com.newrelic.telemetry.http.HttpPoster
        Throws:
        java.io.IOException