n3o Posted June 22, 2017 Posted June 22, 2017 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.