Skip to content

Development #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 7, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update README.md
  • Loading branch information
Kelvin Wijaya authored Nov 16, 2018
commit 776790dd969bf5e0df4edee731f98ace79236d4d
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,22 +181,22 @@ String timestamp = null;
ApiList queryParam = new ApiList();
queryParam.add("query1","value1");

//optional for formList
ApiList formList = new ApiList();
formList.add("param1", "data1");
//optional for formData (x-www-urlencoded)
ApiList formData = new ApiList();
formData.add("param1", "data1");

//If queryParam and formList are both available, combine the list before submitting
formList.addAll(queryParam);
formData.addAll(queryParam);

try {
String signature = ApiSigning.getSignatureToken(authPrefix, authPrefix, httpMethod, signingUrl, appId, secret, formList, password, alias, certFileName, nonce, timestamp);
String signature = ApiSigning.getSignatureToken(authPrefix, authPrefix, httpMethod, signingUrl, appId, secret, formData, password, alias, certFileName, nonce, timestamp);
} catch (ApiUtilException e) {
e.printStackTrace();
}
```
**NOTE**

For **formList** parameter used for Signature generation, the key value parameters **do not** need to be URL encoded,
For **formData** parameter used for Signature generation, the key value parameters **do not** need to be URL encoded,
When your client program is making the actual HTTP POST call, the key value parameters **has** to be URL encoded

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can add examples snippet on how both are done?


Expand Down