Package dev.arbjerg.lavalink.client.http
Class HttpBuilder
-
- All Implemented Interfaces:
public final class HttpBuilder extends Request.Builder
Utility class assisting with making custom HTTP requests from a client.
-
-
Constructor Summary
Constructors Constructor Description HttpBuilder(Request.Builder internalBuilder)
-
Method Summary
Modifier and Type Method Description final HttpBuilder
path(String path)
Set the path for this request HttpBuilder
addHeader(String name, String value)
Request
build()
HttpBuilder
cacheControl(CacheControl cacheControl)
HttpBuilder
delete(RequestBody body)
HttpBuilder
get()
HttpBuilder
head()
HttpBuilder
header(String name, String value)
HttpBuilder
headers(Headers headers)
HttpBuilder
method(String method, RequestBody body)
HttpBuilder
patch(RequestBody body)
HttpBuilder
post(RequestBody body)
HttpBuilder
put(RequestBody body)
HttpBuilder
removeHeader(String name)
<T extends Any> HttpBuilder
tag(Class<in T> type, T tag)
HttpBuilder
tag(Object tag)
HttpBuilder
url(URL url)
HttpBuilder
url(String url)
HttpBuilder
url(HttpUrl url)
-
-
Method Detail
-
path
final HttpBuilder path(String path)
Set the path for this request
- Parameters:
path
- the path for the request to make, this will be prefixed with the base url of the node (E.G.- Returns:
The current builder instance, useful for chaining calls
-
addHeader
HttpBuilder addHeader(String name, String value)
-
build
Request build()
-
cacheControl
HttpBuilder cacheControl(CacheControl cacheControl)
-
delete
HttpBuilder delete(RequestBody body)
-
get
HttpBuilder get()
-
head
HttpBuilder head()
-
header
HttpBuilder header(String name, String value)
-
headers
HttpBuilder headers(Headers headers)
-
method
HttpBuilder method(String method, RequestBody body)
-
patch
HttpBuilder patch(RequestBody body)
-
post
HttpBuilder post(RequestBody body)
-
put
HttpBuilder put(RequestBody body)
-
removeHeader
HttpBuilder removeHeader(String name)
-
tag
HttpBuilder tag(Object tag)
-
url
HttpBuilder url(URL url)
-
url
HttpBuilder url(String url)
-
url
HttpBuilder url(HttpUrl url)
-
-
-
-