Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
e27a98ef
Commit
e27a98ef
authored
Nov 27, 2019
by
Greg Messner
Browse files
Mods to post() methods to ensure content-length header is included.
parent
203e968f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/GitLabApiClient.java
View file @
e27a98ef
...
@@ -480,10 +480,13 @@ public class GitLabApiClient {
...
@@ -480,10 +480,13 @@ public class GitLabApiClient {
* @return a ClientResponse instance with the data returned from the endpoint
* @return a ClientResponse instance with the data returned from the endpoint
*/
*/
protected
Response
post
(
Form
formData
,
URL
url
)
{
protected
Response
post
(
Form
formData
,
URL
url
)
{
if
(
formData
instanceof
GitLabApiForm
)
if
(
formData
instanceof
GitLabApiForm
)
{
return
(
invocation
(
url
,
null
).
post
(
Entity
.
entity
(
formData
.
asMap
(),
MediaType
.
APPLICATION_FORM_URLENCODED_TYPE
)));
return
(
invocation
(
url
,
null
).
post
(
Entity
.
entity
(
formData
.
asMap
(),
MediaType
.
APPLICATION_FORM_URLENCODED_TYPE
)));
else
}
else
if
(
formData
!=
null
)
{
return
(
invocation
(
url
,
null
).
post
(
Entity
.
entity
(
formData
,
MediaType
.
APPLICATION_FORM_URLENCODED_TYPE
)));
return
(
invocation
(
url
,
null
).
post
(
Entity
.
entity
(
formData
,
MediaType
.
APPLICATION_FORM_URLENCODED_TYPE
)));
}
else
{
return
(
invocation
(
url
,
null
).
post
(
Entity
.
entity
(
new
Form
(),
MediaType
.
APPLICATION_FORM_URLENCODED_TYPE
)));
}
}
}
/**
/**
...
@@ -495,7 +498,7 @@ public class GitLabApiClient {
...
@@ -495,7 +498,7 @@ public class GitLabApiClient {
* @return a ClientResponse instance with the data returned from the endpoint
* @return a ClientResponse instance with the data returned from the endpoint
*/
*/
protected
Response
post
(
MultivaluedMap
<
String
,
String
>
queryParams
,
URL
url
)
{
protected
Response
post
(
MultivaluedMap
<
String
,
String
>
queryParams
,
URL
url
)
{
return
(
invocation
(
url
,
queryParams
).
post
(
null
));
return
(
invocation
(
url
,
queryParams
).
post
(
Entity
.
entity
(
new
Form
(),
MediaType
.
APPLICATION_FORM_URLENCODED_TYPE
)
));
}
}
/**
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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