I'm writing an application which uses AngularJS 1.4.0 which requires the ability to receive POST data from an external application. I know that routes in AngularJS often do parameters in the URL such as this:
.when('/section/:param', {
templateUrl: 'views/home.html',
controller: 'AppCtrl'
})
The problem with this style is that in my case the parameter is often very very long and it will cause the web server to ignore / truncate the request / parameter because the URL exceeds the maximum URL length.
For this reason, instead of a standard GET style parameter, I would like the application to receive a POST parameter, but I am not sure how to capture the parameter(s) and value(s).
Is there a way for Angular to capture the POST parameters directly? My second option would be to simply have an ng-init
which uses a backend to grab the values, but I'd prefer to keep the parameters solely in Angular if possible. Thanks!