angularjs - Add skipauthorization to request object using Restangular -


i'm using satellizer handle authentication on app, default satellizer intercepts request , adds authorization header. request api using restangular don't want send authorization header in request make, example login , signup endpoints doesn't need header. if add skipauthorization: true request object, satellizer won't add authorization header. question is, how can add the skipauthorization property of request using restangular.

i tried

restangular.all('signup').withhttpconfig({'skipauthorization': true}).post(user) 

but "withhttpconfig" not function i'm loooking for.

you need write request interceptor:

// set full request interceptor  restangularprovider.setfullrequestinterceptor(function (element, operation, route, url, headers, params, httpconfig) {    return {     element: element,     params: params,     headers: headers,     httpconfig: _.extend(httpconfig, {skipauthorization: true})   };  }); 

Comments

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

SQL Server - MyCTE query based on 24 hour period (next day) -

php - Using str_replace to translate a MySQL Table in html -