unigui作中間件使用


unigui作中間件使用

可返回string或者tstream數據。

如果返回JSON字符,則UNIGUI就是REST 中間件。

procedure TUniServerModule.UniGUIServerModuleHTTPCommand(ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo; var Handled: Boolean);
var
cmd, sql: string;
begin
cmd := ARequestInfo.URI;
if Pos('query', cmd) > 0 then
begin
sql := ARequestInfo.Params.Values['sql'];
if sql <> '' then
begin
Handled := true;
AResponseInfo.CharSet := 'UTF-8';
AResponseInfo.ContentType := 'UTF-8';
AResponseInfo.ContentText := 'unigui中間件';
end;
end;
end;

瀏覽器打開 URL:http://127.0.0.1:9999/query/?sql=select * from tgoods

 

 




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM