Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mjitechauto
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanggang
mjitechauto
Commits
4c303d54
Commit
4c303d54
authored
May 09, 2019
by
wanggang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化温度post方法
parent
39886551
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
src/main/java/com/mjitech/qa/service/BaseService.java
+4
-8
No files found.
src/main/java/com/mjitech/qa/service/BaseService.java
View file @
4c303d54
...
@@ -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"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment