Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. http Response

http Response

Scheduled Pinned Locked Moved Visual Basic
helpcsharphtmldatabasedotnet
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Y Offline
    Y Offline
    ybasha
    wrote on last edited by
    #1

    Hi all, I am runing an application which will check URL in my database there are around 3000 url in my database and i use .net http response and request to check the url the following are the code snippet.. Public Function checkurl(ByVal url As String) As String Dim req As System.Net.HttpWebRequest Dim res As System.Net.HttpWebResponse Dim r As System.IO.StreamReader Dim ex As Exception 'error exeption holder Dim pge As String 'page holder Dim title As String Dim strreturnstring As String 'url = "http://www.getforme.com/e404.htm" ' not working becos have charset =ISO - 8859-1 'url = "http://environmentalchemistry.com/" not working becos have charset = iso - 8859-1 'url = "https://www.iclub.com/investorama.html" Try 'display request url req = req.Create(url) req.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)" req.AllowAutoRedirect = True 'get page res = req.GetResponse() r = New System.IO.StreamReader(res.GetResponseStream()) 'pge = r.ReadToEnd r.Close() res.Close() strError = "OK" status = "True" 'Convention is First Value is the Status and Second value is Errmsg strreturnstring = status & "~" & strError Return strreturnstring Catch ex status = "False" strError = ex.Message strreturnstring = status & "~" & strError Return strreturnstring End Try End Function my code working fine but the problem is when my code run URL which as charset = iso - 8859-1 or charset = windows - 1252 it just thro exception that The remote server returned an error: (400) Bad Request. or The underlyng connection is close.. can any one tell the reason why, Thanx for your interest :) regards cyus

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups