Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function handleRequest(method, url, withCredentials, params, options) {
  2.         var req = {
  3.             method: method,
  4.             url: buildUrl(url),
  5.             withCredentials: withCredentials
  6.         }
  7.  
  8.         if (params) {
  9.             req['params'] = params
  10.         }
  11.  
  12.         if (options) {
  13.             options.forEach(function(option) {
  14.                 req[option.key] = option.val
  15.             });
  16.         }
  17.  
  18.         return($http(req).then(handleSuccess, handleError));
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement