Class NetworkHandler


  • public class NetworkHandler
    extends Object
    This is a network util class.
    • Field Detail

      • JSON

        public static final @NonNull okhttp3.MediaType JSON
      • TEXT

        public static final @NonNull okhttp3.MediaType TEXT
    • Constructor Detail

      • NetworkHandler

        public NetworkHandler​(Plugin plugin,
                              top.focess.util.network.NetworkHandler.Options options)
        Initialize a new network handler with specified options
        Parameters:
        plugin - the plugin
        options - the options
      • NetworkHandler

        public NetworkHandler​(Plugin plugin)
        Initialize a new network handler with default options
        Parameters:
        plugin - the plugin
    • Method Detail

      • getPlugin

        public Plugin getPlugin()
      • request

        public top.focess.util.network.HttpResponse request​(String url,
                                                            Map<String,​Object> data,
                                                            top.focess.util.network.NetworkHandler.RequestType requestType)
      • request

        public top.focess.util.network.HttpResponse request​(String url,
                                                            top.focess.util.network.NetworkHandler.RequestType requestType)
      • request

        public top.focess.util.network.HttpResponse request​(String url,
                                                            Map<String,​Object> data,
                                                            Map<String,​String> header,
                                                            okhttp3.MediaType mediaType,
                                                            top.focess.util.network.NetworkHandler.RequestType requestType)