Search code examples
javahttpjersey-client

Jersey client gives me different result than other client.


I am working on a Geometry Dash API for Java. I am using WireShark to find out how should some requests look like and then try to do some requests using this, then I write a some java code doing the request and parsing the response. But there's a request, that works inside the restlet client: enter image description here

So I am getting:

1:TheRealC05:2:42854106:13:77:17:52:10:17:11:12:3:1051:46:1467:4:23:8:0:18:1:19:0:50:0:20::21:129:22:51:23:30:24:32:25:1:26:18:28:1:43:14:48:1:30:0:16:7450834:31:0:44::45::49:0:29:1

But doesn't work with Jersey client:

final Form form = new Form();
form.param("secret", getSecret());
form.param("gameVersion", "21");
form.param("binaryVersion", "34");
form.param("targetAccountID", "7450834");
final String text = this.httpClient.target(getDatabase()
        .path("/getGJUserInfo20.php")).request()
        .buildPost(Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE))
        .invoke(String.class);

Here I am getting -1.

So what is the difference between those two requests?


Solution

  • The problem is, that I was extending path to the database, so the method got wrong database url.