Skip to content

Instantly share code, notes, and snippets.

@Pajn
Created May 25, 2014 13:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pajn/0cabd8389c0ea4cf66e5 to your computer and use it in GitHub Desktop.
Save Pajn/0cabd8389c0ea4cf66e5 to your computer and use it in GitHub Desktop.
/**
* Shortcut method for GET requests. See [Http.call] for a complete description
* of parameters.
*/
Future<HttpResponse> get(String url, {String data, Map<String, dynamic> params,
Map<String, String> headers, xsrfHeaderName,
xsrfCookieName, interceptors, cache, timeout}
) => _http.get(url, data: data, params: params,
headers: headers, xsrfHeaderName: xsrfHeaderName,
xsrfCookieName: xsrfCookieName, interceptors: interceptors,
cache: cache, timeout: timeout)
.catchError((_) => _router.go('login', {}), test: _isAuthError);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment