I am trying to send a GET request to the HTTP server through the HTTPSend component of the Synapse library. Well, for example:
HTTP := THTTPSend.Create; try HTTP.ProxyHost := 'PROXYHOST'; HTTP.ProxyPort := '8080'; if not HTTP.HTTPMethod('GET', 'http://yandex.ru') then showmessage('error'); Memo1.Lines.Assign(HTTP.Headers); Memo2.Lines.LoadFromStream(HTTP.Document); finally HTTP.Free; end;
In response, I get the following:
HTTP/1.1 407 Proxy Authentication Required ( Для выполнения запроса компоненту Forefront TMG требуется авторизация. Доступ к фильтру веб-прокси запрещен. ) Via: 1.1 ACCESS Proxy-Authenticate: Negotiate Proxy-Authenticate: Kerberos Proxy-Authenticate: NTLM Connection: Keep-Alive Proxy-Connection: Keep-Alive Pragma: no-cache Cache-Control: no-cache Content-Type: text/html Content-Length: 4953
And browsers work through the same proxy without authorization. It may need to explicitly specify some parameters in the header, tried to copy the query exactly to the exact parameters and its header did not help the query formed by the browser when going to the URL . Moreover, HTTP / HTTPS could programmatically send requests until Forefront TMG was installed. With idHTTP, the same problem. Tell me who faced what could be the reason for this behavior.