Example usage for com.google.gwt.gadgets.client.io AuthorizationType SIGNED

List of usage examples for com.google.gwt.gadgets.client.io AuthorizationType SIGNED

Introduction

In this page you can find the example usage for com.google.gwt.gadgets.client.io AuthorizationType SIGNED.

Prototype

AuthorizationType SIGNED

To view the source code for com.google.gwt.gadgets.client.io AuthorizationType SIGNED.

Click Source Link

Usage

From source file:com.google.gwt.gadgets.sample.traveler.client.TravelerServletClient.java

License:Apache License

public void getUsersLocations(String userId, ResponseReceivedHandler<JsArray<Location>> callback) {
    String url = servletUrl;//from   w w w.ja  v a 2 s .  c o m
    url += "?nocache=" + Math.random();
    if (userId != null) {
        url += "&userId=" + userId;
    }

    RequestOptions opts = RequestOptions.newInstance().setAuthorizationType(AuthorizationType.SIGNED);
    io.makeRequestAsJso(url, callback, opts);
}

From source file:com.google.gwt.gadgets.sample.traveler.client.TravelerServletClient.java

License:Apache License

public void saveLocation(Location location, ResponseReceivedHandler<Object> callback) {
    RequestOptions params = RequestOptions.newInstance();
    params.setMethodType(MethodType.POST).setPostData(io.encodeValues(location));
    params.setAuthorizationType(AuthorizationType.SIGNED);
    io.makeRequest(servletUrl, callback, params);
}

From source file:com.google.gwt.gadgets.sample.traveler.client.TravelerServletClient.java

License:Apache License

public void deleteLocation(Location location, ResponseReceivedHandler<Object> callback) {
    String url = servletUrl + "?key=" + location.getKey();
    RequestOptions params = RequestOptions.newInstance();
    params.setMethodType(MethodType.DELETE).setAuthorizationType(AuthorizationType.SIGNED);
    io.makeRequest(url, callback, params);
}