Commit 4c303d54 by wanggang

优化温度post方法

parent 39886551
...@@ -810,23 +810,19 @@ public class BaseService { ...@@ -810,23 +810,19 @@ public class BaseService {
/** /**
* 获取温度专用 * 获取温度专用发送方法
* @param url
* @author android
* @date 2019-05-07
* */ * */
public JSONObject httppostHeaderContainerStatusReturnJson(String url) public JSONObject httppostHeaderContainerStatusReturnJson(String url)
throws ClientProtocolException, IOException { throws ClientProtocolException, IOException {
HttpPost hp = new HttpPost(url); HttpPost hp = new HttpPost(url);
//String appid = "mjitech2016" ;
//System.out.println("appid:"+appid);
String timestamp = System.currentTimeMillis()+""; String timestamp = System.currentTimeMillis()+"";
//String serverCer = "Mjitech2016";
String mjitech_machine_cert = DigestUtils.md5Hex("TWppdGVjaDIwMTY=" + "mjitech2016" + timestamp); String mjitech_machine_cert = DigestUtils.md5Hex("TWppdGVjaDIwMTY=" + "mjitech2016" + timestamp);
System.out.println("mjitech_machine_cert:"+mjitech_machine_cert);
System.out.println("timestamp:"+System.currentTimeMillis());
hp.setHeader("appid", "mjitech2016"); hp.setHeader("appid", "mjitech2016");
hp.setHeader("mjitech-machine-cert",mjitech_machine_cert); hp.setHeader("mjitech-machine-cert",mjitech_machine_cert);
hp.setHeader("timestamp",timestamp); hp.setHeader("timestamp",timestamp);
//String body = "{\"type\":\"ST\"}";
// hp.setEntity(new StringEntity(body));
hr = hc.execute(hp); hr = hc.execute(hp);
entity = hr.getEntity(); entity = hr.getEntity();
BufferedReader postresult = new BufferedReader(new InputStreamReader(entity.getContent(), "UTF-8")); BufferedReader postresult = new BufferedReader(new InputStreamReader(entity.getContent(), "UTF-8"));
......
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