Class HTTPService


  • public class HTTPService
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.http.HttpClient getClient()  
      static HTTPService getInstance()  
      java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<java.lang.String>> sendRequest​(java.lang.String IP, java.lang.String url, HTTPService.HTTPMethods method, java.lang.String requestBody)
      Send HTTP request using the app default port
      • Methods inherited from class java.lang.Object

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

      • getInstance

        public static HTTPService getInstance()
      • getClient

        public java.net.http.HttpClient getClient()
      • sendRequest

        public java.util.concurrent.CompletableFuture<java.net.http.HttpResponse<java.lang.String>> sendRequest​(java.lang.String IP,
                                                                                                                @NotNull
                                                                                                                java.lang.String url,
                                                                                                                @NotNull
                                                                                                                HTTPService.HTTPMethods method,
                                                                                                                @NotNull
                                                                                                                java.lang.String requestBody)
        Send HTTP request using the app default port
        Parameters:
        IP - - domain or IP without / at the start ex: "192.168.0.14"
        url - - path to ping with slash : "/test"
        method - - HTTP request method GET or POST or DELETE or PUT
        requestBody -
        Returns:
        response