What you've said makes sense and matches my expectations for such a security-driven change, yes, but it doesn't match my findings:
All GET parameters are ignored.
That doesn't seem to be the case right now. I changed my current client to use POST instead of GET but with no other changes--specifically it still uses the query string to pass all parameters and doesn't provide any POST body--and it works just fine. It doesn't seem like query parameters (i.e., “GET parameters”) are ignored right now when the method is POST. I'll provide a concrete example below.
So, everything should be in the POST body. And it can be posted as an URL formatted string (so, take everything you were using as GET parameters and use them as POST parameters).
That was actually the first thing I tried. Again, to be perfectly clear, I changed my client to issue a POST request against:
https://wyday.com/limelm/api/rest
with the following as the POST body:
api_key=apiKey&format=json&method=limelm.pkey.getID&pkey=licenseKey
and it failed with:
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="fail"><err code="101" msg="Method not provided."/></rsp>
I've tried the same thing against limelm.test.echo
and that yields the same error response.
To be even more concrete, here's pretty much exactly how I've been issuing the request via GET which works just fine:
WebTarget client = ClientBuilder
.newClient()
.target("https://wyday.com/limelm/api/rest")
.queryParam("method", "limelm.pkey.getID")
.queryParam("format", "json")
.queryParam("api_key", apiKey)
.queryParam("pkey", licenseKey);
Response response = client.request().get();
// Process the JSON response
and as stated, it also works fine when using POST with query params on the URL and no POST body, i.e.:
WebTarget client = ClientBuilder
.newClient()
.target("https://wyday.com/limelm/api/rest")
.queryParam("method", "limelm.pkey.getID")
.queryParam("format", "json")
.queryParam("api_key", apiKey)
.queryParam("pkey", licenseKey);
Response response = client.request().post(null);
// Process the JSON response
but trying to issue a POST with the query string used as the POST body yields a “Method not provided” error:
WebTarget client = ClientBuilder
.newClient()
.target("https://wyday.com/limelm/api/rest");
Entity<Object> postBody = Entity.text(
"method=limelm.pkey.getID" +
"&format=json" +
"&api_key=" + apiKey +
"&pkey=" + licenseKey
);
Response response = client.request().post(postBody);
// Fails with "101: Method not provided"
Based on what you've said, though, that's how it should work, correct? Apologies if I'm still missing something simple here.
And note that I've reproduced this exact behavior using other HTTP clients such as curl and the integrated JetBrains HTTP client, e.g. the following request in the JetBrains HTTP client (where apiKey
and licenseKey
are properly specified, of course):
POST https://wyday.com/limelm/api/rest
method=limelm.pkey.getID&format=json&api_key=apiKey&pkey=licenseKey
yields:
HTTP/1.1 200 OK
Date: Sat, 18 Dec 2021 21:57:53 GMT
Content-Type: text/xml;charset=UTF-8
...
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="fail">
<err code="101" msg="Method not provided."/>
</rsp>
and the following request:
POST https://wyday.com/limelm/api/rest?method=limelm.pkey.getID&format=json&api_key=apiKey&pkey=licenseKey
yields:
HTTP/1.1 200 OK
Date: Sat, 18 Dec 2021 22:20:40 GMT
Content-Type: application/json
...
jsonLimeLMApi({
"pkey": {
"id": <redacted>
},
"stat": "ok"
})
Let me know if that doesn't help.