package com.fireflysource.net.http.client;

import com.fireflysource.common.lifecycle.LifeCycle;
import com.fireflysource.net.http.common.model.HttpMethod;
import com.fireflysource.net.http.common.model.HttpURI;
import com.fireflysource.net.websocket.client.WebSocketClientConnectionBuilder;

import java.net.URL;
import java.util.concurrent.CompletableFuture;

/**
 * @author Pengtao Qiu
 */
public interface HttpClient extends LifeCycle {

    /**
     * Create a RequestBuilder with GET method and URL.
     *
     * @param url The request URL.
     * @return A new RequestBuilder that helps you to build an HTTP request.
     */
    HttpClientRequestBuilder get(String url);

    /**
     * Create a RequestBuilder with POST method and URL.
     *
     * @param url The request URL.
     * @return A new RequestBuilder that helps you to build an HTTP request.
     */
    HttpClientRequestBuilder post(String url);

    /**
     * Create a RequestBuilder with HEAD method and URL.
     *
     * @param url The request URL.
     * @return A new RequestBuilder that helps you to build an HTTP request.
     */
    HttpClientRequestBuilder head(String url);

    /**
     * Create a RequestBuilder with PUT method and URL.
     *
     * @param url The request URL.
     * @return A new RequestBuilder that helps you to build an HTTP request.
     */
    HttpClientRequestBuilder put(String url);

    /**
     * Create a RequestBuilder with DELETE method and URL.
     *
     * @param url The request URL.
     * @return A new RequestBuilder that helps you to build an HTTP request.
     */
    HttpClientRequestBuilder delete(String url);

    /**
     * Create a RequestBuilder with HTTP method and URL.
     *
     * @param method The HTTP method.
     * @param url    The request URL.
     * @return A new RequestBuilder that helps you to build an HTTP request.
     */
    HttpClientRequestBuilder request(HttpMethod method, String url);

    /**
     * Create a RequestBuilder with HTTP method and URL.
     *
     * @param method The HTTP method.
     * @param url    The request URL.
     * @return A new RequestBuilder that helps you to build an HTTP request.
     */
    HttpClientRequestBuilder request(String method, String url);

    /**
     * Create a RequestBuilder with HTTP method and URL.
     *
     * @param method The HTTP method.
     * @param url    The request URL.
     * @return A new RequestBuilder that helps you to build an HTTP request.
     */
    HttpClientRequestBuilder request(String method, URL url);

    /**
     * Create a RequestBuilder with HTTP method and URL.
     *
     * @param method  The HTTP method.
     * @param httpURI The HTTP URI.
     * @return A new RequestBuilder that helps you to build an HTTP request.
     */
    HttpClientRequestBuilder request(String method, HttpURI httpURI);

    /**
     * Create a new HTTP client connection.
     *
     * @param httpURI The HTTP URI.
     * @return The new HTTP client connection.
     */
    CompletableFuture<HttpClientConnection> createHttpClientConnection(HttpURI httpURI);

    /**
     * Create a new HTTP client connection.
     *
     * @param httpURI The HTTP URI.
     * @return The new HTTP client connection.
     */
    CompletableFuture<HttpClientConnection> createHttpClientConnection(String httpURI);

    /**
     * Create a websocket connection builder.
     *
     * @return The websocket connnection builder.
     */
    WebSocketClientConnectionBuilder websocket();

    /**
     * Create a websocket connection builder.
     *
     * @param url The websockte url.
     * @return The websocket connnection builder.
     */
    WebSocketClientConnectionBuilder websocket(String url);
}

@@ -3401,33 +3401,32 @@
 e websocket conn
-n
 ection builder.%0A
@@ -3574,18 +3574,18 @@
  websock
-t
 e
+t
  url.%0A  
@@ -3615,17 +3615,16 @@
 ket conn
-n
 ection b

fix the typo