Tengo el siguiente código en Delphi :
function Check(const UserAgent: string; const Server: string; const Resource: string; const Data: AnsiString): string;
var
hInet: HINTERNET;
hHTTP: HINTERNET;
hReq: HINTERNET;
Buffer: array of AnsiChar;
i, BufferLen: Cardinal;
const
accept: packed array of LPWSTR = (PChar('*/*'), nil);
header: string = 'Content-Type: application/x-www-form-urlencoded';
begin
Result := '';
hInet := InternetOpen(PChar(UserAgent), INTERNET_OPEN_TYPE_PRECONFIG,
nil, nil, 0);
try
hHTTP := InternetConnect(hInet, PChar(Server), INTERNET_DEFAULT_HTTP_PORT, nil, nil, INTERNET_SERVICE_HTTP, 0, 1);
try ...