Skip to content

Commit

Permalink
Development (#76)
Browse files Browse the repository at this point in the history
App API for AppIDRequest with body and tokens
  • Loading branch information
rotembr authored and motyd committed Mar 13, 2018
1 parent 81fef1c commit 43c9c92
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,33 @@ public void send(final ResponseListener listener, final RequestBody requestBody,
}
}

public void send(final ResponseListener listener, final RequestBody requestBody, final AccessToken accessToken, final IdentityToken identityToken) {

if (accessToken != null && identityToken != null) {
removeHeaders("Authorization");
addHeader("Authorization", "Bearer " + accessToken.getRaw() + " " + identityToken.getRaw());
}

if (requestBody != null) {
super.sendRequest(null, listener, requestBody);
} else {
send(listener);
}
}

@Override
public void send (JSONObject json, ResponseListener listener) {
super.send(json, listener);
}

public void send (JSONObject json, ResponseListener listener, final AccessToken accessToken, final IdentityToken identityToken) {
if (accessToken != null && identityToken != null) {
removeHeaders("Authorization");
addHeader("Authorization", "Bearer " + accessToken.getRaw() + " " + identityToken.getRaw());
}
super.send(json, listener);
}

@Override
public void send (Map<String, String> formParameters, ResponseListener listener) {
super.send(formParameters, listener);
Expand Down

0 comments on commit 43c9c92

Please sign in to comment.