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.

  • Do browsers from the same host work without authentication? Or you simply did not notice this (i.e., the user / password is remembered, okay). If browsers are not authenticated, pretend to be a browser (user-agent query field). Otherwise - log in. - alexlz

1 answer 1

The essence of the problem is understood, I will understand further here is a reference, which may give rise to thoughts if someone will have the same problem

NTLM authentication - what is better and how?