Change RuneLiteAPI#apiRoot to #sessionBase
- Rename apiRoot method to sessionBase method - Move /session context path to sessionBase method Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -95,9 +95,9 @@ public class RuneLiteAPI
|
|||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HttpUrl getApiRoot()
|
public static HttpUrl getSessionBase()
|
||||||
{
|
{
|
||||||
return HttpUrl.parse(BASE);
|
return HttpUrl.parse(BASE + "/session");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static HttpUrl getApiBase()
|
public static HttpUrl getApiBase()
|
||||||
|
|||||||
@@ -39,8 +39,7 @@ class SessionClient
|
|||||||
{
|
{
|
||||||
UUID open() throws IOException
|
UUID open() throws IOException
|
||||||
{
|
{
|
||||||
HttpUrl url = RuneLiteAPI.getApiRoot().newBuilder()
|
HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
|
||||||
.addPathSegment("session")
|
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
@@ -62,8 +61,7 @@ class SessionClient
|
|||||||
|
|
||||||
void ping(UUID uuid) throws IOException
|
void ping(UUID uuid) throws IOException
|
||||||
{
|
{
|
||||||
HttpUrl url = RuneLiteAPI.getApiRoot().newBuilder()
|
HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
|
||||||
.addPathSegment("session")
|
|
||||||
.addPathSegment("ping")
|
.addPathSegment("ping")
|
||||||
.addQueryParameter("session", uuid.toString())
|
.addQueryParameter("session", uuid.toString())
|
||||||
.build();
|
.build();
|
||||||
@@ -83,8 +81,7 @@ class SessionClient
|
|||||||
|
|
||||||
void delete(UUID uuid) throws IOException
|
void delete(UUID uuid) throws IOException
|
||||||
{
|
{
|
||||||
HttpUrl url = RuneLiteAPI.getApiRoot().newBuilder()
|
HttpUrl url = RuneLiteAPI.getSessionBase().newBuilder()
|
||||||
.addPathSegment("session")
|
|
||||||
.addQueryParameter("session", uuid.toString())
|
.addQueryParameter("session", uuid.toString())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user