Hi,
I'm using unigui with indy and want to send data through http post, but I got error "Connection Closed Gracefully", how to resolve that?
here my code :
function TUniMainModule.HttpRequestEx(AMethod: THTTPMethod; AUrl, ABody,
ACustomHeader: string): TJSONValue;
var
_ret: string;
_sl: TStringList;
begin
_sl := TStringList.Create;
try
_http.Request.CustomHeaders.FoldLines := False;
if ACustomHeader <> '' then
_http.Request.CustomHeaders.Text := Trim(ACustomHeader)
else
_http.Request.CustomHeaders.Add(Format('AUTH-TOKEN=%s',[TokenKey]));
_sl.Text := ABody;
_ret := _http.Post(AUrl,_sl);
Result := TJSONUtils.StringToObject(_ret)
finally
FreeAndNil(_sl);
end;
end;
Thank.