Results 1 to 3 of 3

Thread: get http response without redirects

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2002
    Posts
    58

    get http response without redirects

    I have used WinHttp.WinHttpRequest (as show in this post) but the problem is it does the redirects and gives me the final status (of 200) when I am more interested in the 301 or 301 redirect from the original URL.
    -------------------------------
    StupidMonkee

  2. #2

    Thread Starter
    Member
    Join Date
    Aug 2002
    Posts
    58

    Re: get http response without redirects

    allow me to answer my own post:
    I just had to turn off the enable redirects and ... success!

    Code:
      Dim WebLink As WinHttp.WinHttpRequest
    
      Set WebLink = New WinHttp.WinHttpRequest
      
      WebLink.Option(WinHttpRequestOption_EnableRedirects) = False
    
      WebLink.Open "GET", "http://www.cnet.com/news"
      WebLink.Send
      
      MsgBox WebLink.Status
    -------------------------------
    StupidMonkee

  3. #3
    Hyperactive Member Disiance's Avatar
    Join Date
    Sep 2004
    Location
    Denver, CO
    Posts
    439

    Re: get http response without redirects

    Try using Winsock. Connect to the server, send the HTTP headers, and wait for the response.

    See if this thread helps you:
    http://www.vbforums.com/showthread.p...winsock+DLFile
    "I don't want to live alone until I'm married" - M.M.R.P

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width