Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
09aad11f
authored
May 04, 2017
by
xueli.xue
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调用超时时间设置10s
parent
fc5b6fa6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
xxl-job-core/src/main/java/com/xxl/job/core/util/HttpClientUtil.java
xxl-job-core/src/main/java/com/xxl/job/core/util/HttpClientUtil.java
View file @
09aad11f
...
@@ -2,6 +2,7 @@ package com.xxl.job.core.util;
...
@@ -2,6 +2,7 @@ package com.xxl.job.core.util;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.client.config.RequestConfig
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.ByteArrayEntity
;
import
org.apache.http.entity.ByteArrayEntity
;
import
org.apache.http.entity.ContentType
;
import
org.apache.http.entity.ContentType
;
...
@@ -39,6 +40,12 @@ public class HttpClientUtil {
...
@@ -39,6 +40,12 @@ public class HttpClientUtil {
}
}
httpPost.setEntity(new UrlEncodedFormEntity(formParams, "UTF-8"));
httpPost.setEntity(new UrlEncodedFormEntity(formParams, "UTF-8"));
}*/
}*/
// timeout
RequestConfig
requestConfig
=
RequestConfig
.
custom
().
setSocketTimeout
(
10000
).
setConnectTimeout
(
10000
).
build
();
httpPost
.
setConfig
(
requestConfig
);
// data
if
(
date
!=
null
)
{
if
(
date
!=
null
)
{
httpPost
.
setEntity
(
new
ByteArrayEntity
(
date
,
ContentType
.
DEFAULT_BINARY
));
httpPost
.
setEntity
(
new
ByteArrayEntity
(
date
,
ContentType
.
DEFAULT_BINARY
));
}
}
...
...
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