com.ost.lib.OSTRequestClient

Here are the examples of the java api com.ost.lib.OSTRequestClient taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

19 Source : OSTServiceManifest.java
with MIT License
from ostdotcom

public abstract clreplaced OSTServiceManifest {

    protected OSTRequestClient request;

    public OSTServiceManifest(Map<String, Object> params) {
        request = new OSTRequestClient(params);
    }
}

16 Source : SignatureTest.java
with MIT License
from ostdotcom

public String getSignature(String resource, Map<String, Object> paramValObj, OSTRequestClient obj) {
    ArrayList<OSTRequestClient.HttpParam> paramsArray = (ArrayList<OSTRequestClient.HttpParam>) obj.getRequestParam(resource, paramValObj);
    String paramKey;
    String paramVal;
    Iterator it = paramsArray.iterator();
    while (it.hasNext()) {
        OSTRequestClient.HttpParam pair = (OSTRequestClient.HttpParam) it.next();
        paramKey = pair.getParamName();
        paramVal = pair.getParamValue();
        if (paramKey.equalsIgnoreCase("api_signature")) {
            return paramVal;
        }
    }
    return "";
}

15 Source : SignatureTest.java
with MIT License
from ostdotcom

@Test
public void testSignature() throws Exception {
    HashMap<String, Object> params = getParams();
    String apiKey = "b921b46142cbfbea3328d9d257ac5b0d";
    String apiSecret = "a0431203671f42c079b2154066fd04ba";
    String apiEndpoint = "https://api.ost.com/mainnet/v2/";
    HashMap<String, Object> ostParams = getParams();
    ostParams.put("apiSecret", apiSecret);
    ostParams.put("apiKey", apiKey);
    ostParams.put("apiEndpoint", apiEndpoint);
    // Test-Case: Test Signature.
    String signature;
    OSTRequestClient obj = new OSTRequestClient(ostParams);
    signature = getSignature("/api/v2/users", params, obj);
    boolean success;
    if (signature.equalsIgnoreCase("28664cdbc613b66835d7bcf825dce719fb8e0621992c291ba9bd1767c1c5560d")) {
        success = true;
    } else {
        success = false;
    }
    replacedert.replacedertEquals(success, true);
}