记得上下班打卡 | git大法好,push需谨慎

Commit 71dae14b authored by 张国柄's avatar 张国柄

fix:http

parent 9bd368e9
package com.liquidnet.commons.lang.util; package com.liquidnet.commons.lang.util;
import com.liquidnet.commons.lang.util.spring.SpringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.*; import org.springframework.http.*;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
...@@ -17,7 +14,7 @@ public class HttpUtil { ...@@ -17,7 +14,7 @@ public class HttpUtil {
private static RestTemplate restTemplate; private static RestTemplate restTemplate;
static { static {
restTemplate = SpringUtils.getBean(RestTemplate.class); restTemplate = new RestTemplate();
} }
/** /**
...@@ -178,4 +175,9 @@ public class HttpUtil { ...@@ -178,4 +175,9 @@ public class HttpUtil {
targetStr = targetStr.replace("%3D", "=").replace("%26", "&"); targetStr = targetStr.replace("%3D", "=").replace("%26", "&");
return targetStr; return targetStr;
} }
public static void main(String[] args) {
String s = HttpUtil.get("www.baidu.com", null);
System.out.println(s);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment