Last post Jun 30, 2020 01:10 PM by magosleandroveloso
Jun 30, 2020 01:10 PM|magosleandroveloso|LINK
I'm using the google maps API to get the distance between two addresses.
Dim url As String = "https://maps.googleapis.com/maps/api/distancematrix/xml?origins=RuaBrasil&destinations=RuaItapeva&key=
Dim request As WebRequest = WebRequest.Create(url)
Using response As WebResponse = CType(request.GetResponse(), HttpWebResponse)
Using reader As StreamReader = New StreamReader(response.GetResponseStream(), Encoding.UTF8)
Dim dsResult As DataSet = New DataSet()
Label1.Text = dsResult.Tables("distance").Rows(0)("text").ToString
I need to exit through the proxy and set it up in web.config.
<proxy proxyaddress="http://proxy" bypassonlocal="True"/>
When I access it through the internet explorer (using the proxy settings) I can access the normal address, but when I access the application, I get error 400 (Bad Request - Invalid URL). I added a Label and put it to display the address, I can access it
through IE, but as I said, the application gives an error.
When I remove the Proxy address from the web.config and access on localhost it works, however on the server I need to exit through the proxy.