How can i send this call in body > raw in angular

2019-08-27 19:00发布

问题:

This work in postman

And my call is

$http({
              method: 'POST',
              url: CONFIG.APIURL+"api/XXXX/XXX/XXXX",
              headers: { 
                'Content-Type': 'application/json; charset=utf-8',
                'CREDENTIALS':  'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'
              },
              data:params2
            }).then(function(response) {
                sucursales=response.XXX.XXX.XXX;
                deferred.resolve(response);
            },function( msg , code ) {
                  alert('fracasoo');    
                  deferred.reject(msg);
                  $log.error(msg, code);
            });

How can i this call and pass the data un body > raw ?

SOLUTION :

$http({
                method: 'POST',
                url: CONFIG.APIURL+"api/Comentarios",
                'processData': false,
                'crossDomain': true ,
                headers: { 
                    'Content-Type': 'application/json',
                    'CREDENTIALS':  'XXXXXXXX',
                    'Cache-Control': 'no-cache'
                },
                data: "\"{XX:0,XX:10,XX:20170220,XX:20170420,XX:"+XX+"}\"\n"  
            }).then(function(response) {
                alert("exito comentarios from server");
                comentarios=response.XX.XX.XX;
                deferred.resolve(response);
            },function(msg, code) {
                  alert("fracaso comentarios from server");
                  deferred.reject(msg);
                  $log.error(msg, code);
            });

Here the data travel in body > raw and capture well in service web