I can make a post with HTML quietly, but when I try to do with Delphi, it presents me with this error:
link
Follow the code below:
function TForm1.UploadArquivo(server, script, caminhoarq : string) : boolean;
var
Response : String;
HTTPClient : TIdHTTP;
Lista : TStringList;
begin
result := False;
HTTPClient := TidHTTP.Create;
HTTPClient.ProtocolVersion := pv1_0;
HTTPClient.Request.Accept := 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
HTTPClient.Request.UserAgent := 'Mozilla/3.0 (compatible; Indy Library)';
Response := '';
Lista := TStringList.Create;
try
try
Lista.Add('Arquivo='+ caminhoarq);
Response := Trim(HTTPClient.Post(server + script, Lista));
Label1.Caption := Response;
if Response = 'OK' then
Result := true;
finally
Lista.Free;
HTTPClient.free;
end;
except
on e:exception do ShowMessage('Erro ao enviar arquivo ao servidor! Detalhes: '+e.Message);
end;
end;
Using Delphi XE7, is there any particularity?
What am I doing wrong?