troubleshooting Question

VB.NET Post REST HTTP request without http in baseaddress

Avatar of bizantd
bizantdFlag for Australia asked on
Web ApplicationsWeb ServicesWeb Development
12 Comments1 Solution481 ViewsLast Modified:
I have api which requires to connect to HOST with out using http.For example its using serverbase address="someipwithout http".

I am getting this error:{"Invalid URI: The URI scheme is not valid."}

However if I use wfetech it works fine.

My Code is as follow

Dim serverAddress = "someip:customport"
Dim URI As String = "/some uri"

Dim client As New HttpClient(handler)
client.BaseAddress = New Uri(serverAddress)
client.DefaultRequestHeaders.Accept.Add(New MediaTypeWithQualityHeaderValue("application/xml"))
Dim response = client.PostAsXmlAsync(URI, x).Result()

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 12 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros