How to write the httpserver response header????
CodePudding user response:
Alternative solution to compile Apache or IIS modulesCodePudding user response:
Procedure TServer. IdHTTPServerCommandGet (AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);Var
CContext: TClientContext;
T: TSomeThread;
The begin
//Beep;
//Sleep (10000);
T:=TSomeThread. Create (true);
T.F reeOnTerminate:=true;
T.S tart.
AResponseInfo. ResponseNo:=200;
AResponseInfo. CacheControl:='no - cache;
AResponseInfo. CustomHeaders. Add (' Access - Control - Allow - Origin: * ');
AResponseInfo. ContentText:='ok';
AResponseInfo. ResponseNo:=200;
AResponseInfo. WriteContent;
The end;