IdHTTPServer允许跨域访问
IdHTTPServer允许跨域访问
procedure TMain.idHttpServerCommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo); begin AResponseInfo.CustomHeaders.Add('Access-Control-Allow-Origin:*'); AResponseInfo.CustomHeaders.Add('Access-Control-Allow-Headers:*'); AResponseInfo.CustomHeaders.Add('Access-Control-Allow-Method:*'); end;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/p/11262024.html