Skip to content

Commit

Permalink
Simplify code.
Browse files Browse the repository at this point in the history
  • Loading branch information
khmarbaise committed Mar 31, 2019
1 parent d4b0c13 commit 8707e40
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public <R extends BaseModel, D> R post(String path, D data, Class<R> cls, boolea
@Override
public <R extends BaseModel, D> R post(String path, D data, Class<R> cls, Map<String, File> fileParams, boolean crumbFlag) throws IOException {
HttpPost request = new HttpPost(UrlUtils.toJsonApiUri(uri, context, path));
if (crumbFlag == true) {
if (crumbFlag) {
Crumb crumb = getQuietly("/crumbIssuer", Crumb.class);
if (crumb != null) {
request.addHeader(new BasicHeader(crumb.getCrumbRequestField(), crumb.getCrumb()));
Expand Down Expand Up @@ -301,7 +301,7 @@ public void post_form(String path, Map<String, String> data, boolean crumbFlag)
request = new HttpPost(UrlUtils.toNoApiUri(uri, context, path));
}

if (crumbFlag == true) {
if (crumbFlag) {
Crumb crumb = get("/crumbIssuer", Crumb.class);
if (crumb != null) {
request.addHeader(new BasicHeader(crumb.getCrumbRequestField(), crumb.getCrumb()));
Expand Down Expand Up @@ -333,7 +333,7 @@ public HttpResponse post_form_with_result(String path, List<NameValuePair> data,
request = new HttpPost(UrlUtils.toNoApiUri(uri, context, path));
}

if (crumbFlag == true) {
if (crumbFlag) {
Crumb crumb = get("/crumbIssuer", Crumb.class);
if (crumb != null) {
request.addHeader(new BasicHeader(crumb.getCrumbRequestField(), crumb.getCrumb()));
Expand All @@ -358,7 +358,7 @@ public String post_xml(String path, String xml_data) throws IOException {
@Override
public String post_xml(String path, String xml_data, boolean crumbFlag) throws IOException {
HttpPost request = new HttpPost(UrlUtils.toJsonApiUri(uri, context, path));
if (crumbFlag == true) {
if (crumbFlag) {
Crumb crumb = getQuietly("/crumbIssuer", Crumb.class);
if (crumb != null) {
request.addHeader(new BasicHeader(crumb.getCrumbRequestField(), crumb.getCrumb()));
Expand Down Expand Up @@ -394,7 +394,7 @@ public String post_text(String path, String textData, boolean crumbFlag) throws
public String post_text(String path, String textData, ContentType contentType, boolean crumbFlag)
throws IOException {
HttpPost request = new HttpPost(UrlUtils.toJsonApiUri(uri, context, path));
if (crumbFlag == true) {
if (crumbFlag) {
Crumb crumb = get("/crumbIssuer", Crumb.class);
if (crumb != null) {
request.addHeader(new BasicHeader(crumb.getCrumbRequestField(), crumb.getCrumb()));
Expand Down

0 comments on commit 8707e40

Please sign in to comment.