extend CommonRequest for GsonRequest

This commit is contained in:
Timi
2025-07-24 18:46:35 +08:00
parent 91ef5e3bc3
commit 016e0b0962
3 changed files with 22 additions and 10 deletions

View File

@@ -32,6 +32,10 @@ public class CommonRequest {
return request.execute().returnContent().asString();
}
public Number asNumber() throws IOException {
return Double.parseDouble(asString());
}
public byte[] asBytes() throws IOException {
return request.execute().returnContent().asBytes();
}