title: WinHTTP Request fails (timeout). Why?
body: <p>So, I'm trying to send a request to a http server from VBA using the WinHttpRequest class.</p>
  
  <p>I've already made a similar code which sends requests to another server, and it worked. This one won't even go through the ".Send". It fails (timeout).</p>
  
  <p>I've checked every RequestHeader at Google Chrome devtools and tried to replicate the web request, but failed (with and without the cookies).</p>
  
  <p>Any ideas?</p>
  
  <p>The code:</p>
  
  <pre>
      Dim WHTTP As New WinHttp.WinHttpRequest
  
      With WHTTP
          .Open "GET", "https://contactcenter-prd.prosodie.com/prweb/sso", False
          .SetRequestHeader "Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8"
          .SetRequestHeader "Accept-Encoding", "gzip, deflate, br"
          .SetRequestHeader "Accept-Language", "pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7"
          .SetRequestHeader "Connection", "keep-alive"
          '.SetRequestHeader "Cookie", "JSESSIONID=337C72E2DBCC1080C674033FFC51EBFA.contactcenter; Pega-RULES=" & Chr(34) & "{atn}e3ByfVkzNDBlc3NYRlBYdWFRT2dkRFRjekU5LytjNm51MEMwazI4YmJqVDNvaFlUTE1LQUN3T1p6SUVYMEd5dlUxaHRSWEVINFpJTWVhY1YKdCtpRkQwZjJLdz09" & Chr(34) & "; BWROUTEID=s2ac70d938fbd5ee39c5b1b93ac33d7b.1"
          .SetRequestHeader "Host", "contactcenter-prd.prosodie.com"
          .SetRequestHeader "Upgrade-Insecure-Requests", "1"
          '.SetRequestHeader "User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36" ' From Chrome
          .SetRequestHeader "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" ' Some guy said it would work (it didn't)
          '.SetTimeouts 1200000, 1200000, 1200000, 1200000
          .Send
      End With
  </pre>
  
  <p><b>EDIT:</b></p>
  
  <p>The purpose of the macro is to enter the website, get some info, put the info into a worksheet and exit the website.</p>
  
  <p>I'm aware that the URL redirects to another, but (I think) I <b>have to</b> go to the first website to get some cookies.</p>
  
  <p><b>EDIT 2:</b></p>
  
  <p>Problem solved.</p>
  
  <p>I had to setup a proxy to use the website.
  <code>.SetProxy 2, myProxy</code> did the trick!</p>