Set user agent header when making http requests
This commit is contained in:
parent
74b9bfdcc3
commit
864a6b476b
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue