记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
0bdbbc49
Commit
0bdbbc49
authored
Jul 21, 2021
by
张国柄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:http
parent
d45adfb0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
HttpUtil.java
...c/main/java/com/liquidnet/commons/lang/util/HttpUtil.java
+9
-1
No files found.
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/HttpUtil.java
View file @
0bdbbc49
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
;
...
@@ -11,6 +14,11 @@ import java.util.List;
...
@@ -11,6 +14,11 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
public
class
HttpUtil
{
public
class
HttpUtil
{
private
static
RestTemplate
restTemplate
;
static
{
restTemplate
=
SpringUtils
.
getBean
(
RestTemplate
.
class
);
}
/**
/**
* get请求
* get请求
...
@@ -142,7 +150,7 @@ public class HttpUtil {
...
@@ -142,7 +150,7 @@ public class HttpUtil {
}
}
HttpEntity
<
Object
>
httpEntity
=
new
HttpEntity
(
params
,
httpHeaders
);
HttpEntity
<
Object
>
httpEntity
=
new
HttpEntity
(
params
,
httpHeaders
);
RestTemplate
restTemplate
=
new
RestTemplate
();
//
RestTemplate restTemplate = new RestTemplate();
// 提交方式:表单、json
// 提交方式:表单、json
ResponseEntity
<
String
>
response
=
restTemplate
.
exchange
(
url
,
method
,
httpEntity
,
String
.
class
);
ResponseEntity
<
String
>
response
=
restTemplate
.
exchange
(
url
,
method
,
httpEntity
,
String
.
class
);
return
response
.
getBody
();
return
response
.
getBody
();
...
...
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