Package com.wrapper.spotify
Interface IHttpManager
-
- All Known Implementing Classes:
SpotifyHttpManager
public interface IHttpManagerA simple HTTP connection interface.
-
-
Method Summary
Modifier and Type Method Description java.lang.Stringdelete(java.net.URI uri, org.apache.http.Header[] headers, org.apache.http.HttpEntity body)Perform an HTTP DELETE request to the specified URL.java.lang.Stringget(java.net.URI uri, org.apache.http.Header[] headers)Perform an HTTP GET request to the specified URL.java.lang.Stringpost(java.net.URI uri, org.apache.http.Header[] headers, org.apache.http.HttpEntity body)Perform an HTTP POST request to the specified URL.java.lang.Stringput(java.net.URI uri, org.apache.http.Header[] headers, org.apache.http.HttpEntity body)Perform an HTTP PUT request to the specified URL.
-
-
-
Method Detail
-
get
java.lang.String get(java.net.URI uri, org.apache.http.Header[] headers) throws java.io.IOException, SpotifyWebApiExceptionPerform an HTTP GET request to the specified URL.- Parameters:
uri- The GET request'sURI.headers- The GET request'sHeaders.- Returns:
- A string containing the GET request's response body.
- Throws:
java.io.IOException- In case of networking issues.SpotifyWebApiException- The Web API returned an error further specified in this exception's root cause.
-
post
java.lang.String post(java.net.URI uri, org.apache.http.Header[] headers, org.apache.http.HttpEntity body) throws java.io.IOException, SpotifyWebApiExceptionPerform an HTTP POST request to the specified URL.- Parameters:
uri- The POST request'sURI.headers- The POST request'sHeaders.body- The PUT request's body as aHttpEntity.- Returns:
- A string containing the POST request's response body.
- Throws:
java.io.IOException- In case of networking issues.SpotifyWebApiException- The Web API returned an error further specified in this exception's root cause.
-
put
java.lang.String put(java.net.URI uri, org.apache.http.Header[] headers, org.apache.http.HttpEntity body) throws java.io.IOException, SpotifyWebApiExceptionPerform an HTTP PUT request to the specified URL.- Parameters:
uri- The PUT request'sURI.headers- The PUT request'sHeaders.body- The PUT request's body as aHttpEntity.- Returns:
- A string containing the PUT request's response body.
- Throws:
java.io.IOException- In case of networking issues.SpotifyWebApiException- The Web API returned an error further specified in this exception's root cause.
-
delete
java.lang.String delete(java.net.URI uri, org.apache.http.Header[] headers, org.apache.http.HttpEntity body) throws java.io.IOException, SpotifyWebApiExceptionPerform an HTTP DELETE request to the specified URL.- Parameters:
uri- The DELETE request'sURI.headers- The DELETE request'sHeaders.body- The DELETE request's body as aHttpEntity.- Returns:
- A string containing the DELETE request's response body.
- Throws:
java.io.IOException- In case of networking issues.SpotifyWebApiException- The Web API returned an error further specified in this exception's root cause.
-
-