idhttpserver的commandget方法是这样写的:
-----------------------------------
if requestinfo.command = post then
try
coinitialize(nil);
post_data := requestinfo.params.gettext;
try
if(post_data<>)then
begin
q_so.close;
q_so.sql.clear;
q_so.sql.add(insert into +v_tbname+ select seq_pc_ods.nextval,+post_data+,0,sysdate from dual);
q_so.prepare;
q_so.execsql;
//savefile(post_data,inttostr(v_suc_num+1)+.txt);
v_suc_num := v_suc_num +1;
if memo1.lines.count>300 then
memo1.lines.clear;
memo1.lines.add(post_data);
statusbar.panels[1].text:=成功接收:+inttostr(v_suc_num)+条,接收失败:+inttostr(v_fail_num) + 条;
end;
except on e: exception do
begin
write_err_log(接收失败:+e.message);
v_fail_num:=v_fail_num+1;
responseinfo.responseno := 500;
responseinfo.contenttext := post_data;
responseinfo.contentlength := length(post_data);
couninitialize;
exit;
end;
end;
finally
couninitialize;
end;
-----------------------------------
if requestinfo.command = post then
try
coinitialize(nil);
post_data := requestinfo.params.gettext;
try
if(post_data<>)then
begin
q_so.close;
q_so.sql.clear;
q_so.sql.add(insert into +v_tbname+ select seq_pc_ods.nextval,+post_data+,0,sysdate from dual);
q_so.prepare;
q_so.execsql;
//savefile(post_data,inttostr(v_suc_num+1)+.txt);
v_suc_num := v_suc_num +1;
if memo1.lines.count>300 then
memo1.lines.clear;
memo1.lines.add(post_data);
statusbar.panels[1].text:=成功接收:+inttostr(v_suc_num)+条,接收失败:+inttostr(v_fail_num) + 条;
end;
except on e: exception do
begin
write_err_log(接收失败:+e.message);
v_fail_num:=v_fail_num+1;
responseinfo.responseno := 500;
responseinfo.contenttext := post_data;
responseinfo.contentlength := length(post_data);
couninitialize;
exit;
end;
end;
finally
couninitialize;
end;