Set user agent header when making http requests

This commit is contained in:
daniel oeh 2013-08-31 13:33:57 +02:00
parent 74b9bfdcc3
commit 864a6b476b
2 changed files with 5 additions and 0 deletions

View File

@ -3,4 +3,6 @@ package de.danoeh.antennapod;
public final class AppConfig {
/** Should be used for debug logging. */
public final static boolean DEBUG = true;
/** Should be used when setting User-Agent header for HTTP-requests. */
public final static String USER_AGENT = "AntennaPod/0.9.8.0";
}

View File

@ -1,5 +1,6 @@
package de.danoeh.antennapod.gpoddernet;
import de.danoeh.antennapod.AppConfig;
import de.danoeh.antennapod.gpoddernet.model.GpodnetDevice;
import de.danoeh.antennapod.gpoddernet.model.GpodnetPodcast;
import de.danoeh.antennapod.gpoddernet.model.GpodnetSubscriptionChange;
@ -17,6 +18,7 @@ import org.apache.http.client.methods.HttpPut;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.auth.BasicScheme;
import org.apache.http.params.CoreProtocolPNames;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
@ -43,6 +45,7 @@ public class GpodnetService {
public GpodnetService() {
httpClient = new GpodnetClient();
httpClient.getParams().setParameter(CoreProtocolPNames.USER_AGENT, AppConfig.USER_AGENT);
}
/**