Example usage for com.google.gwt.gadgets.client.io RequestOptions newInstance

List of usage examples for com.google.gwt.gadgets.client.io RequestOptions newInstance

Introduction

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

Prototype

public static RequestOptions newInstance() 

Source Link

Document

Returns new instance of RequestOptions .

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  ww .j av  a2  s . com
    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);
}