1. Some system methods, such as. NET System method Httputility.urlencode ' = ' is encoded as '%3d ' instead of%3d, causing the cryptographic signature to pass through validation, please check with the developer.
In 2.Java 1.3 and earlier versions, some special characters were not encoded, such as asterisks (*), when the method under Java.net.URLEncoder was called for URL encoding. because the asterisk (*) must be encoded in the URL encoding rule, if the above method is used in the request string with an asterisk (*), the resulting signature cannot be validated. For example, when calling the V3/pay/buy_goods interface, the Payitem parameter value must contain *, after encoding using the method under Class Java.net.URLEncoder, the developer will manually replace the asterisk character "*" with "%2a". failure to do so will cause the cryptographic signature to pass through validation, and the developer should be aware of the check.
3. The UrlEncode method in some languages encodes "space" as "+" and should actually be encoded as "%2b". This will also generate the wrong signature, causing the signature to pass through validation. Please check with the developer to manually replace "+" with "%2b". In PHP, URL encoding is recommended using the Rawurlencode method.
The following is an urlencode rewrite about the C # language:
/// <summary> ///urlencode rewrite: lowercase to uppercase, special word traits classes/// </summary> /// <param name= "STRSRC" >Original String</param> /// <param name= "encoding" >Encoding Method</param> /// <param name= "Btoupper" >whether to turn uppercase</param> /// <returns></returns> Private stringUrlEncode (stringSTRSRC, System.Text.Encoding Encoding,BOOLbtoupper) {System.Text.StringBuilder StringBuilder=NewSystem.Text.StringBuilder (); for(inti =0; i < strsrc.length; i++) { stringt =Strsrc[i]. ToString (); stringK =Httputility.urlencode (t, encoding); if(T = =k) {stringbuilder.append (t); } Else { if(Btoupper) stringbuilder.append (K.toupper ()); ElseStringbuilder.append (k); } } returnStringbuilder.tostring (). Replace ("+","%2b"); }
Call Method:
string org_loc = this. UrlEncode ("/dfdasf/get_api_m", Encoding.UTF8, True);
Httputility.urlencode encoding Rewrite