Search code examples
asp.netvb.netiis-10

Doing an http post in vb.net can't see detail errors on iis 10


I have an aspx script and am trying to do an http post.

I was able to get a GET working to the resource that I want to use by doing:

Dim webClient As New System.Net.WebClient
Dim result As String = webClient.DownloadString("http://222.222.100.1/api/webclient")

I was trying to do a post by doing:

 Using client As New Net.WebClient
  Dim postdata = client.UploadString("http://222.222.100.1/api/webclient", "age")
 End Using

I want to start with a simple test and build on it. Is the client.UploadString the best thing to use?

I am also having major issues with getting errors to show. When I have an error, I get the default internal server error page.

In my web root, I have a web config with

<customErrors mode="Detailed" /> 
<compilation debug="true" />

When I get the error, it shows customErrors mode="Off". Why is iis 10 overriding what is in my web root? I have access to the server and can change things, just don't know what to change and hours of search has yielded nothing. Any suggestions would be appreciated.


Solution

  • The issue with the webclient was that I needed the import "Imports System.Net". The issue with the errors not showing was that I needed it to say customErrors="Off".