in VBA i am creating a URL:
URL = "http://api.local.yahoo.com/MapsService/V1/geocode?appid=" & yahoo & "&street=" & street & "&city=" & city & "&state=" & state & "&zip=" & zip
for example it sets itself to equal this:
http://api.local.yahoo.com/MapsService/V1/geocode?appid=username123&street=1893 n. clyde morris blvd &city=daytona beach&state=FL&zip=32117
when i manually go to this URL, IT WORKS FINE.
however when i do this:
'Create Http object
If IsEmpty(http) Then Set http = CreateObject("WinHttp.WinHttpRequest.5.1")
'Send request To URL
http.Open "GET", URL
http.send
'Get response data As a string
response = http.responseText
it's giving me this for the response:
response="Watch : : response : "<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><title>Yahoo! - 400 Bad Request</title><style>
/* nn4 hide */
/*/*/
bod........"
please note that 50% of the time it returns the correct URL and 50% it gives me a 400 bad request
what am i doing wrong?
wrikken has suggested that i get a URLencoder, but i believe that it was encoding it correctly!