package com.wrapper.spotify;

import com.wrapper.spotify.exceptions.SpotifyWebApiException;
import org.apache.hc.core5.http.Header;
import org.apache.hc.core5.http.HttpEntity;
import org.apache.hc.core5.http.ParseException;

import java.io.IOException;
import java.net.URI;

/**
 * A simple HTTP connection interface.
 */
public interface IHttpManager {

  /**
   * Perform an HTTP GET request to the specified URL.
   *
   * @param uri     The GET request's {@link URI}.
   * @param headers The GET request's {@link Header}s.
   * @return A string containing the GET request's response body.
   * @throws IOException            In case of networking issues.
   * @throws SpotifyWebApiException The Web API returned an error further specified in this exception's root cause.
   */
  String get(URI uri, Header[] headers) throws
    IOException,
    SpotifyWebApiException,
    ParseException;

  /**
   * Perform an HTTP POST request to the specified URL.
   *
   * @param uri     The POST request's {@link URI}.
   * @param headers The POST request's {@link Header}s.
   * @param body    The PUT request's body as a {@link HttpEntity}.
   * @return A string containing the POST request's response body.
   * @throws IOException            In case of networking issues.
   * @throws SpotifyWebApiException The Web API returned an error further specified in this exception's root cause.
   */
  String post(URI uri, Header[] headers, HttpEntity body) throws
    IOException,
    SpotifyWebApiException,
    ParseException;

  /**
   * Perform an HTTP PUT request to the specified URL.
   *
   * @param uri     The PUT request's {@link URI}.
   * @param headers The PUT request's {@link Header}s.
   * @param body    The PUT request's body as a {@link HttpEntity}.
   * @return A string containing the PUT request's response body.
   * @throws IOException            In case of networking issues.
   * @throws SpotifyWebApiException The Web API returned an error further specified in this exception's root cause.
   */
  String put(URI uri, Header[] headers, HttpEntity body) throws
    IOException,
    SpotifyWebApiException,
    ParseException;

  /**
   * Perform an HTTP DELETE request to the specified URL.
   *
   * @param uri     The DELETE request's {@link URI}.
   * @param headers The DELETE request's {@link Header}s.
   * @param body    The DELETE request's body as a {@link HttpEntity}.
   * @return A string containing the DELETE request's response body.
   * @throws IOException            In case of networking issues.
   * @throws SpotifyWebApiException The Web API returned an error further specified in this exception's root cause.
   */
  String delete(URI uri, Header[] headers, HttpEntity body) throws
    IOException,
    SpotifyWebApiException,
    ParseException;

}

@@ -760,38 +760,120 @@
 n's root cause.%0A
+   * @throws ParseException         The response could not be parsed as a string.%0A
    */%0A
-
   String get(URI
@@ -1453,32 +1453,114 @@
 n's root cause.%0A
+   * @throws ParseException         The response could not be parsed as a string.%0A
    */%0A  String p
@@ -2160,32 +2160,114 @@
 n's root cause.%0A
+   * @throws ParseException         The response could not be parsed as a string.%0A
    */%0A  String p
@@ -2765,32 +2765,32 @@
 working issues.%0A
-
    * @throws Spo
@@ -2885,24 +2885,106 @@
 root cause.%0A
+   * @throws ParseException         The response could not be parsed as a string.%0A
    */%0A  Stri

Add Throws Javadoc