Ionic 2: Client Certificate Authentication HTTP Request

Has anyone already implemented a Certificate Authenticated HTTP Request? When I open the url of my internal service with the Chrome browser on my mobile, it asks for a client certificate and that's ok. When I open the url in my Ionic 2 app, only "ERROR NULL ANSWER" appears. Does anyone know how to handle this? I am open to any ideas, Thanks

+3


source to share


1 answer


You can try this code. If you get any error please comment.

$http({ method: 'POST' or 'GET', url: //where your api locate, data: data, headers : { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' } }).then(function successCallback(response) { //response }, function errorCallback(err) { console.log(err); });



hope this works for you :)

-1


source







All Articles