briandowns/openweathermap

Escape locations with spaces

Closed this issue · 0 comments

This was taken from a comment on the post on Reddit. reddit - @Kealper

The only small issue I've seen so far is that it doesn't make use of net/url's QueryEscape function on the locations, it seems. I actually assumed net/http's client request functions would do this automatically but I guess they must not. For example, this will work fine: w.CurrentByName(url.QueryEscape("Port Huron, MI")) However, doing just this will not: w.CurrentByName("Port Huron, MI") Interestingly, it seems like OWM's API does make some exceptions on requiring escaping for more popular city queries such as "San Francisco, CA" or "San Antonio, TX".