Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sap-service
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
sap-service
Commits
05ec3254
Commit
05ec3254
authored
Aug 05, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
7815ba36
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
HttpUtil.java
src/main/java/com/egolm/sso/util/HttpUtil.java
+8
-8
No files found.
src/main/java/com/egolm/sso/util/HttpUtil.java
View file @
05ec3254
...
@@ -81,9 +81,9 @@ public class HttpUtil {
...
@@ -81,9 +81,9 @@ public class HttpUtil {
}
}
public
static
String
post
(
String
requestUrl
,
Map
<
String
,
Object
>
parameters
,
Map
<
String
,
String
>
headers
)
{
public
static
String
post
(
String
requestUrl
,
Map
<
String
,
Object
>
parameters
,
Map
<
String
,
String
>
headers
)
{
logger
.
debug
(
requestUrl
);
logger
.
debug
(
"post: "
+
requestUrl
);
logger
.
debug
(
JSON
.
toJSONString
(
parameters
));
logger
.
debug
(
"parameters: "
+
JSON
.
toJSONString
(
parameters
));
logger
.
debug
(
JSON
.
toJSONString
(
headers
));
logger
.
debug
(
"headers: "
+
JSON
.
toJSONString
(
headers
));
HttpURLConnection
connection
=
null
;
HttpURLConnection
connection
=
null
;
try
{
try
{
String
requestBody
=
toQueryString
(
parameters
);
String
requestBody
=
toQueryString
(
parameters
);
...
@@ -100,7 +100,7 @@ public class HttpUtil {
...
@@ -100,7 +100,7 @@ public class HttpUtil {
}
}
connection
.
connect
();
connection
.
connect
();
String
result
=
responseBody
(
connection
);
String
result
=
responseBody
(
connection
);
logger
.
debug
(
result
);
logger
.
debug
(
"result: "
+
result
);
return
result
;
return
result
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
...
@@ -111,9 +111,9 @@ public class HttpUtil {
...
@@ -111,9 +111,9 @@ public class HttpUtil {
public
static
String
postRaw
(
String
requestUrl
,
Map
<
String
,
Object
>
parameters
,
Map
<
String
,
String
>
headers
)
{
public
static
String
postRaw
(
String
requestUrl
,
Map
<
String
,
Object
>
parameters
,
Map
<
String
,
String
>
headers
)
{
logger
.
debug
(
requestUrl
);
logger
.
debug
(
"post: "
+
requestUrl
);
logger
.
debug
(
JSON
.
toJSONString
(
parameters
));
logger
.
debug
(
"parameters: "
+
JSON
.
toJSONString
(
parameters
));
logger
.
debug
(
JSON
.
toJSONString
(
headers
));
logger
.
debug
(
"headers: "
+
JSON
.
toJSONString
(
headers
));
HttpURLConnection
connection
=
null
;
HttpURLConnection
connection
=
null
;
OutputStream
os
=
null
;
OutputStream
os
=
null
;
try
{
try
{
...
@@ -134,7 +134,7 @@ public class HttpUtil {
...
@@ -134,7 +134,7 @@ public class HttpUtil {
os
.
write
(
rawData
.
getBytes
());
os
.
write
(
rawData
.
getBytes
());
os
.
flush
();
os
.
flush
();
String
result
=
responseBody
(
connection
);
String
result
=
responseBody
(
connection
);
logger
.
debug
(
result
);
logger
.
debug
(
"result: "
+
result
);
return
result
;
return
result
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
...
...
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