Rationale
Currently, java-tron's HTTP interfaces support GET and POST requests. However, there are some inconsistencies in parameter validation and response between GET and POST calls for the same interface. Here are some examples:
case1: incorrect log level for invalid parameter
/wallet/getapprovedlist
When passing an invalid parameter like modifying type_url to type_url1, the server logs an ERROR:
18:02:57.889 ERROR [qtp464658113-329] [capsule](TransactionCapsule.java:350) Type of the Any message does not match the given class.
case2: inconsistent naming convention for parameters
/wallet/getavailableunfreezecount

The GET and POST requests have inconsistent naming for the parameter ownerAddress (GET) vs owner_address (POST).
case3: GET parameter handling contradicts business logic
/wallet/getcanwithdrawunfreezeamount

For the timestamp parameter, the GET request throws NumberFormatException if missing while POST handles it as 0 by default, which aligns with business logic.
/wallet/getcandelegatedmaxsize

For the type parameter, GET request throws NumberFormatException if missing while POST handles it as 0 by default, which aligns with business logic.
/wallet/getblockbynum

For the num parameter, POST resolves it to 0 without passing it, and GET throws an error. To make it compatible, GET should be consistent with POST.
Implementation
To summarize, 3 cases are listed where GET and POST have inconsistencies. The solutions are as follows:
case1:change log level for invalid parameter validation
case2:standardize naming conventions
case3:align GET handling with POST logic
Rationale
Currently, java-tron's HTTP interfaces support GET and POST requests. However, there are some inconsistencies in parameter validation and response between GET and POST calls for the same interface. Here are some examples:
case1: incorrect log level for invalid parameter
/wallet/getapprovedlistWhen passing an invalid parameter like modifying
type_urltotype_url1, the server logs an ERROR:case2: inconsistent naming convention for parameters
/wallet/getavailableunfreezecountThe GET and POST requests have inconsistent naming for the parameter
ownerAddress(GET) vsowner_address(POST).case3: GET parameter handling contradicts business logic
/wallet/getcanwithdrawunfreezeamountFor the
timestampparameter, the GET request throwsNumberFormatExceptionif missing while POST handles it as 0 by default, which aligns with business logic./wallet/getcandelegatedmaxsizeFor the
typeparameter, GET request throwsNumberFormatExceptionif missing while POST handles it as 0 by default, which aligns with business logic./wallet/getblockbynumFor the
numparameter, POST resolves it to 0 without passing it, and GET throws an error. To make it compatible, GET should be consistent with POST.Implementation
To summarize, 3 cases are listed where GET and POST have inconsistencies. The solutions are as follows:
case1:change log level for invalid parameter validation
case2:standardize naming conventions
case3:align GET handling with POST logic