n3o Posted June 22, 2017 Share 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 Link to comment Share on other sites More sharing options...
n3o Posted June 23, 2017 Author Share Posted June 23, 2017 up Quote Link to comment Share on other sites More sharing options...
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.