エラーのあるサーバーで webclient.downloadstring を使用すると、何も得られません
Try
result = webClient.DownloadString("https://api.bodis.com/domainclassification?domain=" + CurrentBlog.Domain)
Catch ex As Exception
System.Windows.Forms.Application.DoEvents()
End Try
通常、結果には応答が含まれます。ただし、エラーの場合、結果は空です。
私は何かを知りたいです。たとえば、結果が悪くても、通常はカスタム 404 メッセージなどがあります。
api.bodis.com は、安全なものと安全でないものが混在しているため、問題があります。ただし、とにかく Internet Explorer で出力が得られます。webclient を使いたいのですが、出力を知りたいです
ex.response を取得しても何も得られない
Dim adult = webClient.DownloadString("http://googleads.g.doubleclick.net/apps/domainpark/domainpark.cgi?callback=_google_json_callback&output=js&client=ca-dp-godaddy2_xml&domain_name=" + CurrentBlog.Domain)
'ias.NavigateTillComplete("https://api.bodis.com/domainclassification?domain=" + CurrentBlog.Domain)
Dim result = ""
Dim url = "http://api.bodis.com/domainclassification?domain=" + CurrentBlog.Domain
Dim webRequest = DirectCast(System.Net.HttpWebRequest.Create(url), System.Net.HttpWebRequest)
Dim response As HttpWebResponse
Try
response = DirectCast(webRequest.GetResponse(), HttpWebResponse)
Catch ex As System.Net.WebException
System.Windows.Forms.Application.DoEvents()
response = DirectCast(ex.Response, HttpWebResponse) 'is nothing there
End Try
Dim responseStream = response.GetResponseStream