Migrate all HTTP calls to use OkHttp rather than URLConnection.

This commit is contained in:
Andreas Schildbach 2015-06-15 11:18:52 +02:00
parent 4c64746e75
commit 74d552d187
16 changed files with 2135 additions and 2062 deletions

View file

@ -54,6 +54,8 @@ import de.schildbach.pte.dto.StationDepartures;
import de.schildbach.pte.dto.Style;
import de.schildbach.pte.util.ParserUtils;
import okhttp3.HttpUrl;
/**
* @author Andreas Schildbach
*/
@ -171,7 +173,7 @@ public class InvgProvider extends AbstractHafasProvider {
// scrape page
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
appendXmlStationBoardParameters(uri, time, stationId, maxDepartures, false, null);
final CharSequence page = httpClient.get(uri.toString());
final CharSequence page = httpClient.get(HttpUrl.parse(uri.toString()));
// parse page
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);