//首先使用web_reg_save_param方法保存服務器返回的參數,以下: web_reg_save_param ("S_respond","LB=","RB=",LAST); //調用接口 web_custom_request("query", "URL=http://14.119.110.190/", "Method=POST", "TargetFrame=", "RecContentType=text/html", "Resource=0", "Referer=", "Mode=HTML",//HTML或者HTTP均可以 "Body={" "\"version\":\"v1.0\"
"\"requestId\":\"{requestId}\"," "}", LAST); //第一種方法:直接打印服務器返回的字符串 lr_output_message(lr_eval_string("{S_respond}")); //第二種方法:對返回的字符串轉碼 lr_convert_string_encoding ( lr_eval_string ("{S_respond}"),LR_ENC_UTF8 ,NULL,"respond"); //打印轉碼後的響應報文 lr_output_message ( "%s",lr_eval_string ("{respond}"));
編輯打印內容:html
//編輯打印內容:
//\n\nusername is :%s == 換行換行+ username is:+輸出類型;
lr_log_message("\n\nusername is :%s",lr_eval_string("{respond}"));
假設,某以上接口服務器返回的報文爲:web
{"requestId":"0b5628f2326657017903190016","code":"SUCCESS","message":"操做成功","data":{}}服務器