Opened 9 years ago
Closed 9 years ago
#12265 closed enhancement (fixed)
[Patch] Use HttpClient for imagery requests
Reported by: | simon04 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 16.01 |
Component: | Core imagery | Version: | |
Keywords: | http | Cc: | wiktorn |
Description
Since #12231 we have a HttpClient
which encapsulates HttpURLConnection
and is used throughout the code.
JCSCachedTileLoaderJob
and TMSCachedTileLoaderJob
could also make use of this class. Any concerns or objections?
Attachments (1)
Change History (7)
by , 9 years ago
Attachment: | 12265.patch added |
---|
follow-up: 2 comment:1 by , 9 years ago
comment:2 by , 9 years ago
Replying to wiktorn:
There is one thing I do not understand - line 333/324 - why have you changed 304 to 302?
By mistake. I first put in some HttpURLConnection constants, but for a shorter diff I went back to a wrong integer numeral …
Also you've removed 323/322 - logging of requests at INFO level, which was requested in separate ticket.
Logging is done in org.openstreetmap.josm.tools.HttpClient#connect(org.openstreetmap.josm.gui.progress.ProgressMonitor)
follow-up: 5 comment:3 by , 9 years ago
What I wanted to ask: in JCSCachedTileLoaderJob#loadObject
, is there a reason not to use JCSCachedTileLoaderJob#getURLConnection
for getting and filling the URL connection – see my todo?
comment:4 by , 9 years ago
Component: | Core → Core imagery |
---|---|
Keywords: | http added |
comment:5 by , 9 years ago
Replying to simon04:
What I wanted to ask: in
JCSCachedTileLoaderJob#loadObject
, is there a reason not to useJCSCachedTileLoaderJob#getURLConnection
for getting and filling the URL connection – see my todo?
getURLConnection does the cache setting and pass headers provided by client (such as custom HTTP headers for tiles / WMS). This avoids some code duplication, as we are calling this function in few places, so IMO it's good to leave it. So use getUrlConnection in your TODO place.
There is one thing I do not understand - line 333/324 - why have you changed 304 to 302?
Also you've removed 323/322 - logging of requests at INFO level, which was requested in separate ticket.