Package se.michaelthelin.spotify
Interface IHttpManager
- All Known Implementing Classes:
SpotifyHttpManager
public interface IHttpManager
A simple HTTP connection interface.
-
Method Summary
Modifier and TypeMethodDescriptiondelete
(URI uri, org.apache.hc.core5.http.Header[] headers, org.apache.hc.core5.http.HttpEntity body) Perform an HTTP DELETE request to the specified URL.Perform an HTTP GET request to the specified URL.Perform an HTTP POST request to the specified URL.Perform an HTTP PUT request to the specified URL.
-
Method Details
-
get
String get(URI uri, org.apache.hc.core5.http.Header[] headers) throws IOException, SpotifyWebApiException, org.apache.hc.core5.http.ParseException Perform an HTTP GET request to the specified URL.- Parameters:
uri
- The GET request'sURI
.headers
- The GET request'sHeader
s.- Returns:
- A string containing the GET request's response body.
- Throws:
IOException
- In case of networking issues.SpotifyWebApiException
- The Web API returned an error further specified in this exception's root cause.org.apache.hc.core5.http.ParseException
- The response could not be parsed as a string.
-
post
String post(URI uri, org.apache.hc.core5.http.Header[] headers, org.apache.hc.core5.http.HttpEntity body) throws IOException, SpotifyWebApiException, org.apache.hc.core5.http.ParseException Perform an HTTP POST request to the specified URL.- Parameters:
uri
- The POST request'sURI
.headers
- The POST request'sHeader
s.body
- The PUT request's body as aHttpEntity
.- Returns:
- A string containing the POST request's response body.
- Throws:
IOException
- In case of networking issues.SpotifyWebApiException
- The Web API returned an error further specified in this exception's root cause.org.apache.hc.core5.http.ParseException
- The response could not be parsed as a string.
-
put
String put(URI uri, org.apache.hc.core5.http.Header[] headers, org.apache.hc.core5.http.HttpEntity body) throws IOException, SpotifyWebApiException, org.apache.hc.core5.http.ParseException Perform an HTTP PUT request to the specified URL.- Parameters:
uri
- The PUT request'sURI
.headers
- The PUT request'sHeader
s.body
- The PUT request's body as aHttpEntity
.- Returns:
- A string containing the PUT request's response body.
- Throws:
IOException
- In case of networking issues.SpotifyWebApiException
- The Web API returned an error further specified in this exception's root cause.org.apache.hc.core5.http.ParseException
- The response could not be parsed as a string.
-
delete
String delete(URI uri, org.apache.hc.core5.http.Header[] headers, org.apache.hc.core5.http.HttpEntity body) throws IOException, SpotifyWebApiException, org.apache.hc.core5.http.ParseException Perform an HTTP DELETE request to the specified URL.- Parameters:
uri
- The DELETE request'sURI
.headers
- The DELETE request'sHeader
s.body
- The DELETE request's body as aHttpEntity
.- Returns:
- A string containing the DELETE request's response body.
- Throws:
IOException
- In case of networking issues.SpotifyWebApiException
- The Web API returned an error further specified in this exception's root cause.org.apache.hc.core5.http.ParseException
- The response could not be parsed as a string.
-