Commits

renren_platform committed 6469cff

回退的修订集: f9348d0e9049

Comments (0)

Files changed (2)

src/main/java/com/renren/api/client/utils/HttpURLUtils.java

             String fileParamName, String filename, String contentType, byte[] data) {
         HttpURLConnection urlConn = null;
         try {
-			System.setProperty("http.agent", Parameters.USER_AGENT);
             urlConn = sendFormdata(reqUrl, parameters, fileParamName, filename, contentType, data);
             String responseContent = new String(getBytes(urlConn));
             return responseContent.trim();
             String fileParamName, String filename, String contentType, byte[] data) {
         HttpURLConnection urlConn = null;
         try {
-			System.setProperty("http.agent", Parameters.USER_AGENT);
             URL url = new URL(reqUrl);
             urlConn = (HttpURLConnection) url.openConnection();
             urlConn.setRequestMethod("POST");
     private static HttpURLConnection sendPost(String reqUrl, Map<String, String> parameters) {
         HttpURLConnection urlConn = null;
         try {
-			System.setProperty("http.agent", Parameters.USER_AGENT);
             String params = generatorParamString(parameters);
             URL url = new URL(reqUrl);
             urlConn = (HttpURLConnection) url.openConnection();
     private static HttpURLConnection sendGet(String reqUrl, Map<String, String> parameters) {
         HttpURLConnection urlConn = null;
         try {
-			System.setProperty("http.agent", Parameters.USER_AGENT);
             String params = generatorParamString(parameters);
             URL url = new URL(reqUrl);
             urlConn = (HttpURLConnection) url.openConnection();
         try {
             URL url = new URL(link);
             HttpURLConnection conn = (HttpURLConnection) url.openConnection();
-			System.setProperty("http.agent", Parameters.USER_AGENT);
             conn.setRequestMethod("GET");
-//          conn.setRequestProperty("User-Agent", "Mozilla/5.0");
+            conn.setRequestProperty("User-Agent", "Mozilla/5.0");
             BufferedInputStream in = new BufferedInputStream(conn.getInputStream());
             ByteArrayOutputStream out = new ByteArrayOutputStream();
             byte[] buf = new byte[1024];

src/main/java/com/renren/api/client/utils/Parameters.java

-package com.renren.api.client.utils;
-
-public class Parameters {
-	public static final String USER_AGENT = "Renren Java SDK v2.0";
-	public static final String MD5_USER_AGENT = "49e70de73da2f12a8edf5427201089f8";//Renren Java SDK v2.0��md5ֵ
-
-}
-